Updated code regarding to string 32 vs string 8.
This commit is contained in:
@@ -108,8 +108,7 @@ feature -- Basic operations
|
|||||||
handle_precondition_failed (req, res)
|
handle_precondition_failed (req, res)
|
||||||
else
|
else
|
||||||
if attached req.http_if_unmodified_since as l_if_unmodified_since then
|
if attached req.http_if_unmodified_since as l_if_unmodified_since then
|
||||||
if l_if_unmodified_since.is_valid_as_string_8 then
|
create l_date.make_from_string (l_if_unmodified_since)
|
||||||
create l_date.make_from_string (l_if_unmodified_since.to_string_8)
|
|
||||||
if not l_date.has_error then
|
if not l_date.has_error then
|
||||||
if a_handler.modified_since (req, l_date.date_time) then
|
if a_handler.modified_since (req, l_date.date_time) then
|
||||||
handle_precondition_failed (req, res)
|
handle_precondition_failed (req, res)
|
||||||
@@ -117,7 +116,6 @@ feature -- Basic operations
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if not l_failed then
|
if not l_failed then
|
||||||
if attached req.http_if_none_match as l_if_none_match then
|
if attached req.http_if_none_match as l_if_none_match then
|
||||||
l_etags := l_if_none_match.split (',')
|
l_etags := l_if_none_match.split (',')
|
||||||
@@ -128,8 +126,7 @@ feature -- Basic operations
|
|||||||
handle_if_none_match_failed (req, res, a_handler)
|
handle_if_none_match_failed (req, res, a_handler)
|
||||||
else
|
else
|
||||||
if attached req.http_if_modified_since as l_if_modified_since then
|
if attached req.http_if_modified_since as l_if_modified_since then
|
||||||
if l_if_modified_since.is_valid_as_string_8 then
|
create l_date.make_from_string (l_if_modified_since)
|
||||||
create l_date.make_from_string (l_if_modified_since.to_string_8)
|
|
||||||
if not l_date.has_error then
|
if not l_date.has_error then
|
||||||
if not a_handler.modified_since (req, l_date.date_time) then
|
if not a_handler.modified_since (req, l_date.date_time) then
|
||||||
handle_not_modified (req, res, a_handler)
|
handle_not_modified (req, res, a_handler)
|
||||||
@@ -138,7 +135,6 @@ feature -- Basic operations
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if not l_failed then
|
if not l_failed then
|
||||||
check attached {HTTP_HEADER} req.execution_variable (a_handler.Negotiated_http_header_execution_variable) as h then
|
check attached {HTTP_HEADER} req.execution_variable (a_handler.Negotiated_http_header_execution_variable) as h then
|
||||||
-- postcondition header_attached of `handle_content_negotiation'
|
-- postcondition header_attached of `handle_content_negotiation'
|
||||||
|
|||||||
@@ -50,8 +50,14 @@ feature -- Status report
|
|||||||
|
|
||||||
debug_output: READABLE_STRING_GENERAL
|
debug_output: READABLE_STRING_GENERAL
|
||||||
-- String that should be displayed in debugger to represent `Current'.
|
-- String that should be displayed in debugger to represent `Current'.
|
||||||
|
local
|
||||||
|
s: STRING_32
|
||||||
do
|
do
|
||||||
Result := description + {STRING_32} " : " + associated_resource.to_string_32
|
create s.make_empty
|
||||||
|
s.append (description)
|
||||||
|
s.append_string_general (" : ")
|
||||||
|
s.append_string_general (associated_resource)
|
||||||
|
Result := s
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Status
|
feature -- Status
|
||||||
@@ -78,7 +84,7 @@ feature -- Status
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
|
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ feature {WSF_RESPONSE} -- Output
|
|||||||
if request.is_content_type_accepted ({HTTP_MIME_TYPES}.text_html) then
|
if request.is_content_type_accepted ({HTTP_MIME_TYPES}.text_html) then
|
||||||
s := "<html lang=%"en%"><head>"
|
s := "<html lang=%"en%"><head>"
|
||||||
s.append ("<title>")
|
s.append ("<title>")
|
||||||
s.append (html_encoder.encoded_string (request.request_uri.to_string_32))
|
s.append (html_encoder.general_encoded_string (request.request_uri))
|
||||||
s.append ("Error 404 (Not Found)")
|
s.append ("Error 404 (Not Found)")
|
||||||
s.append ("</title>%N")
|
s.append ("</title>%N")
|
||||||
s.append ("[
|
s.append ("[
|
||||||
@@ -101,7 +101,7 @@ feature {WSF_RESPONSE} -- Output
|
|||||||
s.append ("<div class=%"inner2%"></div>")
|
s.append ("<div class=%"inner2%"></div>")
|
||||||
s.append ("</div>")
|
s.append ("</div>")
|
||||||
s.append ("Error 404 (Not Found)</div>")
|
s.append ("Error 404 (Not Found)</div>")
|
||||||
s.append ("<div id=%"message%">Error 404 (Not Found): <code>" + html_encoder.encoded_string (request.request_uri.to_string_32) + "</code></div>")
|
s.append ("<div id=%"message%">Error 404 (Not Found): <code>" + html_encoder.general_encoded_string (request.request_uri) + "</code></div>")
|
||||||
if attached suggested_items as lst and then not lst.is_empty then
|
if attached suggested_items as lst and then not lst.is_empty then
|
||||||
s.append ("<div id=%"suggestions%"><strong>Perhaps you are looking for:</strong><ul>")
|
s.append ("<div id=%"suggestions%"><strong>Perhaps you are looking for:</strong><ul>")
|
||||||
from
|
from
|
||||||
@@ -116,17 +116,17 @@ feature {WSF_RESPONSE} -- Output
|
|||||||
l_text := l_loc
|
l_text := l_loc
|
||||||
end
|
end
|
||||||
s.append ("<li>")
|
s.append ("<li>")
|
||||||
s.append ("<a href=%"" + l_loc + "%">" + html_encoder.encoded_string (l_text.to_string_32) + "</a>")
|
s.append ("<a href=%"" + l_loc + "%">" + html_encoder.general_encoded_string (l_text) + "</a>")
|
||||||
elseif l_text /= Void then
|
elseif l_text /= Void then
|
||||||
|
|
||||||
s.append ("<li>")
|
s.append ("<li>")
|
||||||
s.append (html_encoder.encoded_string (l_text.to_string_32))
|
s.append (html_encoder.general_encoded_string (l_text))
|
||||||
s.append ("</li>%N")
|
s.append ("</li>%N")
|
||||||
end
|
end
|
||||||
if (l_loc /= Void or l_text /= Void) then
|
if (l_loc /= Void or l_text /= Void) then
|
||||||
if attached lst.item.description as l_desc then
|
if attached lst.item.description as l_desc then
|
||||||
s.append ("<br/> - ")
|
s.append ("<br/> - ")
|
||||||
s.append (html_encoder.encoded_string (l_desc.to_string_32))
|
s.append (html_encoder.general_encoded_string (l_desc))
|
||||||
s.append ("%N")
|
s.append ("%N")
|
||||||
end
|
end
|
||||||
s.append ("</li>%N")
|
s.append ("</li>%N")
|
||||||
|
|||||||
Reference in New Issue
Block a user