Implemented support for base url in httpd connector.

This commit is contained in:
2015-03-25 22:22:57 +01:00
parent b4a9c92ffc
commit 7d2ce8a77f
19 changed files with 168 additions and 198 deletions

View File

@@ -9,6 +9,10 @@ class
inherit
WGI_CONNECTOR
SHARED_HTML_ENCODER
SHARED_EXECUTION_ENVIRONMENT
feature -- Access
Name: STRING_8 = "CGI"
@@ -27,27 +31,14 @@ feature -- Execution
rescued: BOOLEAN
do
if not rescued then
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment, create {WGI_CGI_INPUT_STREAM}.make, Current)
create req.make (execution_environment.starting_environment, create {WGI_CGI_INPUT_STREAM}.make, Current)
create res.make (create {WGI_CGI_OUTPUT_STREAM}.make, create {WGI_CGI_ERROR_STREAM}.make)
create {G} exec.make (req, res)
exec.execute
res.flush
res.push
exec.clean
else
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then
if res /= Void then
if not res.status_is_set then
res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void)
end
if res.message_writable then
res.put_string ("<pre>")
res.put_string (l_trace)
res.put_string ("</pre>")
end
res.push
end
end
process_rescue (res)
if exec /= Void then
exec.clean
end
@@ -59,6 +50,23 @@ feature -- Execution
end
end
process_rescue (res: detachable WGI_RESPONSE)
do
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.trace as l_trace then
if res /= Void then
if not res.status_is_set then
res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void)
end
if res.message_writable then
res.put_string ("<pre>")
res.put_string (html_encoder.encoded_string (l_trace))
res.put_string ("</pre>")
end
res.push
end
end
end
note
copyright: "2011-2015, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"