Fixed HEAD request related issue
see https://github.com/EiffelWebFramework/EWF/issues/53
This commit is contained in:
@@ -22,6 +22,20 @@ feature {NONE} -- Initialization
|
||||
|
||||
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
|
||||
|
||||
commit
|
||||
|
||||
@@ -31,11 +31,23 @@ feature {NONE} -- Initialization
|
||||
make_with_response (r)
|
||||
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
|
||||
|
||||
wsf_response: WSF_RESPONSE
|
||||
-- Origin WSF response
|
||||
|
||||
commit
|
||||
-- <Precursor/>
|
||||
do
|
||||
if not header_committed then
|
||||
process_header
|
||||
@@ -44,6 +56,7 @@ feature {NONE} -- Implementation
|
||||
end
|
||||
|
||||
process_header
|
||||
-- <Precursor/>
|
||||
require
|
||||
header_not_committed: not header_committed
|
||||
do
|
||||
|
||||
@@ -11,7 +11,10 @@ class
|
||||
|
||||
inherit
|
||||
WSF_RESPONSE
|
||||
rename
|
||||
make_from_wsf as make_from_response
|
||||
redefine
|
||||
make_from_response,
|
||||
put_character,
|
||||
put_string,
|
||||
put_substring,
|
||||
@@ -27,12 +30,9 @@ create
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_from_response (res: WSF_RESPONSE)
|
||||
-- Initialize from `res' (assumed to be a GET response).
|
||||
require
|
||||
res_attached: res /= Void
|
||||
do
|
||||
wsf_response := res
|
||||
make_from_wgi (res.wgi_response)
|
||||
Precursor (res)
|
||||
end
|
||||
|
||||
feature {WSF_RESPONSE} -- Access
|
||||
|
||||
@@ -22,6 +22,9 @@ class
|
||||
create {WSF_TO_WGI_SERVICE}
|
||||
make_from_wgi
|
||||
|
||||
create {WSF_RESPONSE}
|
||||
make_from_wsf
|
||||
|
||||
convert
|
||||
make_from_wgi ({WGI_RESPONSE})
|
||||
|
||||
@@ -34,12 +37,25 @@ feature {NONE} -- Initialization
|
||||
transfered_content_length := 0
|
||||
create header.make
|
||||
wgi_response := r
|
||||
create wres.make (r, Current)
|
||||
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)
|
||||
end
|
||||
wgi_response := wres
|
||||
set_status_code ({HTTP_STATUS_CODE}.ok) -- Default value
|
||||
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
|
||||
-- Associated WGI_RESPONSE.
|
||||
|
||||
Reference in New Issue
Block a user