Updated notification mailer, to always store output messages.

Fixed CMS_RESPONSE, and specific error response, to return expected status code.
This commit is contained in:
2015-09-28 10:47:57 +02:00
parent 7b2e6ab7b4
commit ec53a2682b
8 changed files with 40 additions and 21 deletions

View File

@@ -995,6 +995,7 @@ feature {NONE} -- Execution
page: CMS_HTML_PAGE_RESPONSE
utf: UTF_CONVERTER
h: HTTP_HEADER
l_new_location: READABLE_STRING_8
do
if attached {READABLE_STRING_GENERAL} values.item ("optional_content_type") as l_type then
create cms_page.make_typed (utf.utf_32_string_to_utf_8_string_8 (l_type))
@@ -1010,12 +1011,12 @@ feature {NONE} -- Execution
if attached redirection as l_location then
-- FIXME: find out if this is safe or not.
if l_location.has_substring ("://") then
-- h.put_location (l_location)
response.redirect_now (l_location)
l_new_location := l_location
else
-- h.put_location (request.absolute_url (l_location, Void))
response.redirect_now (absolute_url (l_location, Void))
l_new_location := absolute_url (l_location, Void)
end
-- h.put_location (l_new_location)
response.redirect_now (l_new_location)
else
h.put_header_object (header)

View File

@@ -20,9 +20,10 @@ feature -- Generation
custom_prepare (page: CMS_HTML_PAGE)
do
set_status_code ({HTTP_STATUS_CODE}.bad_request)
page.register_variable (absolute_url (request.percent_encoded_path_info, Void), "request")
page.set_status_code ({HTTP_STATUS_CODE}.bad_request)
page.register_variable (page.status_code.out, "code")
page.set_status_code (status_code)
page.register_variable (status_code.out, "code")
end
feature -- Execution

View File

@@ -20,9 +20,10 @@ feature -- Generation
custom_prepare (page: CMS_HTML_PAGE)
do
set_status_code ({HTTP_STATUS_CODE}.forbidden)
page.register_variable (absolute_url (request.percent_encoded_path_info, Void), "request")
page.set_status_code ({HTTP_STATUS_CODE}.forbidden)
page.register_variable (page.status_code.out, "code")
page.set_status_code (status_code)
page.register_variable (status_code.out, "code")
end
feature -- Execution

View File

@@ -20,9 +20,10 @@ feature -- Generation
custom_prepare (page: CMS_HTML_PAGE)
do
set_status_code ({HTTP_STATUS_CODE}.internal_server_error)
page.register_variable (absolute_url (location, Void), "request")
page.set_status_code ({HTTP_STATUS_CODE}.internal_server_error)
page.register_variable (page.status_code.out, "code")
page.set_status_code (status_code)
page.register_variable (status_code.out, "code")
end
feature -- Execution

View File

@@ -20,9 +20,10 @@ feature -- Generation
custom_prepare (page: CMS_HTML_PAGE)
do
set_status_code ({HTTP_STATUS_CODE}.not_found)
page.register_variable (absolute_url (request.percent_encoded_path_info, Void), "request")
page.set_status_code ({HTTP_STATUS_CODE}.not_found)
page.register_variable (page.status_code.out, "code")
page.set_status_code (status_code)
page.register_variable (status_code.out, "code")
end
feature -- Execution

View File

@@ -20,9 +20,10 @@ feature -- Generation
custom_prepare (page: CMS_HTML_PAGE)
do
set_status_code ({HTTP_STATUS_CODE}.not_implemented)
page.register_variable (absolute_url (request.percent_encoded_path_info, Void), "request")
page.set_status_code ({HTTP_STATUS_CODE}.not_implemented)
page.register_variable (page.status_code.out, "code")
page.set_status_code (status_code)
page.register_variable (status_code.out, "code")
end
feature -- Execution