Fixed HEAD request related issue

see https://github.com/EiffelWebFramework/EWF/issues/53
This commit is contained in:
2013-04-10 09:27:58 +02:00
parent 5fc34d947a
commit f85dc7f550
4 changed files with 49 additions and 6 deletions

View File

@@ -22,6 +22,20 @@ feature {NONE} -- Initialization
wgi_response: WGI_RESPONSE wgi_response: WGI_RESPONSE
feature {WGI_FILTER_RESPONSE} -- Change
update_wgi_response (res: WGI_RESPONSE)
-- Set `wgi_response' with `res'.
do
if wgi_response /= res then
res.set_post_commit_action (wgi_response.post_commit_action)
wgi_response.set_post_commit_action (Void)
else
-- Same response object
end
end
feature {WGI_CONNECTOR, WGI_SERVICE} -- Commit feature {WGI_CONNECTOR, WGI_SERVICE} -- Commit
commit commit

View File

@@ -31,11 +31,23 @@ feature {NONE} -- Initialization
make_with_response (r) make_with_response (r)
end end
feature {WSF_RESPONSE} -- Change
update_wsf_response (res: WSF_RESPONSE)
-- Set `wsf_response' with `res'.
do
wsf_response := res
ensure
wsf_response_set: wsf_response = res
end
feature {NONE} -- Implementation feature {NONE} -- Implementation
wsf_response: WSF_RESPONSE wsf_response: WSF_RESPONSE
-- Origin WSF response
commit commit
-- <Precursor/>
do do
if not header_committed then if not header_committed then
process_header process_header
@@ -44,6 +56,7 @@ feature {NONE} -- Implementation
end end
process_header process_header
-- <Precursor/>
require require
header_not_committed: not header_committed header_not_committed: not header_committed
do do

View File

@@ -11,7 +11,10 @@ class
inherit inherit
WSF_RESPONSE WSF_RESPONSE
rename
make_from_wsf as make_from_response
redefine redefine
make_from_response,
put_character, put_character,
put_string, put_string,
put_substring, put_substring,
@@ -27,12 +30,9 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make_from_response (res: WSF_RESPONSE) make_from_response (res: WSF_RESPONSE)
-- Initialize from `res' (assumed to be a GET response).
require
res_attached: res /= Void
do do
wsf_response := res wsf_response := res
make_from_wgi (res.wgi_response) Precursor (res)
end end
feature {WSF_RESPONSE} -- Access feature {WSF_RESPONSE} -- Access

View File

@@ -22,6 +22,9 @@ class
create {WSF_TO_WGI_SERVICE} create {WSF_TO_WGI_SERVICE}
make_from_wgi make_from_wgi
create {WSF_RESPONSE}
make_from_wsf
convert convert
make_from_wgi ({WGI_RESPONSE}) make_from_wgi ({WGI_RESPONSE})
@@ -34,12 +37,25 @@ feature {NONE} -- Initialization
transfered_content_length := 0 transfered_content_length := 0
create header.make create header.make
wgi_response := r wgi_response := r
if attached {WSF_WGI_DELAYED_HEADER_RESPONSE} r as r_delayed then
wres := r_delayed
wres.update_wsf_response (Current)
else
create wres.make (r, Current) create wres.make (r, Current)
end
wgi_response := wres wgi_response := wres
set_status_code ({HTTP_STATUS_CODE}.ok) -- Default value set_status_code ({HTTP_STATUS_CODE}.ok) -- Default value
end end
feature {WSF_RESPONSE_EXPORTER} -- Properties make_from_wsf (res: WSF_RESPONSE)
do
transfered_content_length := 0
wgi_response := res.wgi_response
header := res.header
set_status_code ({HTTP_STATUS_CODE}.ok) -- Default value
end
feature {WSF_RESPONSE, WSF_RESPONSE_EXPORTER} -- Properties
wgi_response: WGI_RESPONSE wgi_response: WGI_RESPONSE
-- Associated WGI_RESPONSE. -- Associated WGI_RESPONSE.