Added to WSF_REQUEST

- raw_header_data: like meta_string_variable
  - read_input_data_into (buf: STRING)
  - is_content_type_accepted (a_content_type: READABLE_STRING_GENERAL): BOOLEAN
Changed raw_input_data to return IMMUTABLE_STRING_8
Added WSF_METHOD_NOT_ALLOWED_RESPONSE
Added WSF_TRACE_RESPONSE to respond TRACE request
Now Not_found response return html content if the client accepts, other text/plain
Implemented TRACE response, and Method not allowed as implementation of WSF_ROUTED_SERVICE.execute_default
This commit is contained in:
Jocelyn Fiat
2012-12-13 17:29:46 +01:00
parent ff7d963d55
commit b7505e67b8
6 changed files with 417 additions and 54 deletions

View File

@@ -207,6 +207,31 @@ feature -- Status report
end
end
allowed_methods_for_request (req: WSF_REQUEST): WSF_ROUTER_METHODS
-- Allowed methods for `req'
local
m: WSF_ROUTER_MAPPING
l_rqsmethods: detachable WSF_ROUTER_METHODS
do
create Result
across
mappings as c
loop
m := c.item.mapping
if attached {WSF_ROUTING_HANDLER} m.handler as l_routing then
l_rqsmethods := l_routing.router.allowed_methods_for_request (req)
elseif m.is_mapping (req, Current) then
l_rqsmethods := c.item.request_methods
else
l_rqsmethods := Void
end
if l_rqsmethods /= Void then
Result := Result + l_rqsmethods
end
end
end
feature -- Hook
execute_before (a_mapping: WSF_ROUTER_MAPPING)