Extracting HTTP_HEADER_BUILDER from HTTP_HEADER

to provide useful interface on WSF_RESPONSE,
  and make WSF_SESSION easier to use.
This commit is contained in:
2014-03-17 18:10:55 +01:00
parent a2cbcbbbc6
commit 718cebc700
6 changed files with 729 additions and 529 deletions

View File

@@ -60,15 +60,15 @@ feature {NONE} -- Initialization
feature -- Cookie
apply_to (h: HTTP_HEADER; a_request: WSF_REQUEST; a_path: detachable READABLE_STRING_8)
apply_to (h: HTTP_HEADER_BUILDER; a_request: WSF_REQUEST; a_path: detachable READABLE_STRING_8)
local
dt: detachable DATE_TIME
l_domain: detachable READABLE_STRING_8
do
l_domain := a_request.server_name
if l_domain.same_string ("localhost") then
-- Due to limitation of specific handling of local cookies
-- it is recommended to use Void or IP instead of "localhost"
-- Due to limitation of specific handling of local cookies
-- it is recommended to use Void or IP instead of "localhost"
l_domain := Void
end
if is_destroyed then
@@ -177,7 +177,7 @@ feature {NONE} -- Implementation
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -78,12 +78,21 @@ feature -- Control
deferred
end
apply_to (h: HTTP_HEADER; req: WSF_REQUEST; a_path: detachable READABLE_STRING_8)
apply_to (h: HTTP_HEADER_BUILDER; req: WSF_REQUEST; a_path: detachable READABLE_STRING_8)
-- Apply current session to header `h' for request `req' and optional path `a_path'.
-- note: either use `apply_to' or `apply', not both.
deferred
end
apply (req: WSF_REQUEST; res: WSF_RESPONSE; a_path: detachable READABLE_STRING_8)
-- Apply current session to response `res' for request `req' and optional path `a_path'.
-- note: either use `apply' or `apply_to', not both.
do
apply_to (res.header, req, a_path)
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software