Added WSF_DEFAULT_*_RESPONSE

Fixed the method not allowed by setting the Allow: header
This commit is contained in:
Jocelyn Fiat
2012-12-14 15:52:35 +01:00
parent 8e31950285
commit cc570f5abf
4 changed files with 124 additions and 15 deletions

View File

@@ -0,0 +1,53 @@
note
description: "Summary description for {WSF_DEFAULT_RESPONSE}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
WSF_DEFAULT_RESPONSE
inherit
WSF_RESPONSE_MESSAGE
create
make
feature {NONE} -- Initialization
make (req: WSF_REQUEST)
-- Initialize Current with request `req'
do
request := req
end
feature -- Access
request: WSF_REQUEST
-- Associated request.
feature {WSF_RESPONSE} -- Output
send_to (res: WSF_RESPONSE)
-- Send Current message to `res'
--
-- This feature should be called via `{WSF_RESPONSE}.send (obj)'
-- where `obj' is the current object
local
msg: WSF_RESPONSE_MESSAGE
req: like request
not_found: WSF_NOT_FOUND_RESPONSE
trace: WSF_TRACE_RESPONSE
do
req := request
if req.is_request_method ({HTTP_REQUEST_METHODS}.method_trace) then
create trace.make (req)
msg := trace
else
create not_found.make (req)
msg := not_found
end
res.send (msg)
end
end