Return NotFound response for "/favicon.ico" request instead of returning wrong plain text response.
This commit is contained in:
@@ -26,22 +26,27 @@ feature -- Basic operations
|
|||||||
do
|
do
|
||||||
-- To send a response we need to setup, the status code and
|
-- To send a response we need to setup, the status code and
|
||||||
-- the response headers.
|
-- the response headers.
|
||||||
if request.path_info.same_string_general ("/app") then
|
if request.path_info.same_string_general ("/favicon.ico") then
|
||||||
s := websocket_app_html (request.server_name, request.server_port)
|
response.put_header ({HTTP_STATUS_CODE}.not_found, <<["Content-Length", "0"]>>)
|
||||||
else
|
else
|
||||||
s := "Hello World!"
|
if request.path_info.same_string_general ("/app") then
|
||||||
create dt.make_now_utc
|
s := websocket_app_html (request.server_name, request.server_port)
|
||||||
s.append (" (UTC time is " + dt.rfc850_string + ").")
|
|
||||||
s.append ("<p><a href=%"/app%">Websocket demo</a></p>")
|
else
|
||||||
|
s := "Hello World!"
|
||||||
|
create dt.make_now_utc
|
||||||
|
s.append (" (UTC time is " + dt.rfc850_string + ").")
|
||||||
|
s.append ("<p><a href=%"/app%">Websocket demo</a></p>")
|
||||||
|
end
|
||||||
|
response.put_header ({HTTP_STATUS_CODE}.ok, <<["Content-Type", "text/html"], ["Content-Length", s.count.out]>>)
|
||||||
|
response.set_status_code ({HTTP_STATUS_CODE}.ok)
|
||||||
|
response.header.put_content_type_text_html
|
||||||
|
response.header.put_content_length (s.count)
|
||||||
|
if request.is_keep_alive_http_connection then
|
||||||
|
response.header.put_connection_keep_alive
|
||||||
|
end
|
||||||
|
response.put_string (s)
|
||||||
end
|
end
|
||||||
response.put_header ({HTTP_STATUS_CODE}.ok, <<["Content-Type", "text/html"], ["Content-Length", s.count.out]>>)
|
|
||||||
response.set_status_code ({HTTP_STATUS_CODE}.ok)
|
|
||||||
response.header.put_content_type_text_html
|
|
||||||
response.header.put_content_length (s.count)
|
|
||||||
if request.is_keep_alive_http_connection then
|
|
||||||
response.header.put_connection_keep_alive
|
|
||||||
end
|
|
||||||
response.put_string (s)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Websocket execution
|
feature -- Websocket execution
|
||||||
|
|||||||
Reference in New Issue
Block a user