Added some checks for custom erros being set.

This commit is contained in:
Colin Adams
2013-08-12 16:45:47 +01:00
parent 2ed362f5d3
commit b074570e99
2 changed files with 44 additions and 33 deletions

View File

@@ -23,11 +23,17 @@ feature {NONE} -- Implementation
-- "NEGOTIATED_ENCODING"
local
l_dt: STRING
l_ok: BOOLEAN
do
a_handler.delete (req)
l_ok := a_handler.response_ok (req)
if l_ok then
if a_handler.includes_response_entity (req) then
a_handler.ensure_content_available (req)
l_ok := a_handler.response_ok (req)
if l_ok then
a_header.put_content_length (a_handler.content_length (req).as_integer_32)
end
-- we don't bother supporting chunked responses for DELETE.
else
a_header.put_content_length (0)
@@ -50,7 +56,9 @@ feature {NONE} -- Implementation
res.set_status_code ({HTTP_STATUS_CODE}.no_content)
res.put_header_text (a_header.string)
end
else
end
end
if not l_ok then
write_error_response (req, res)
end
end

View File

@@ -26,6 +26,8 @@ feature {NONE} -- Implementation
l_dt: STRING
do
a_handler.ensure_content_available (req)
l_ok := a_handler.response_ok (req)
if l_ok then
l_chunked := a_handler.is_chunking (req)
if l_chunked then
a_header.put_transfer_encoding_chunked
@@ -38,6 +40,7 @@ feature {NONE} -- Implementation
generate_cache_headers (req, a_handler, a_header, l_time)
end
l_ok := a_handler.response_ok (req)
end
if l_ok then
res.set_status_code ({HTTP_STATUS_CODE}.ok)
else