Added put_content_type_utf_8_text_html to HTTP_HEADER .
Improved the directory index access denied message.
This commit is contained in:
@@ -374,6 +374,7 @@ feature -- Content-type helpers
|
|||||||
put_content_type_text_css do put_content_type ({HTTP_MIME_TYPES}.text_css) end
|
put_content_type_text_css do put_content_type ({HTTP_MIME_TYPES}.text_css) end
|
||||||
put_content_type_text_csv do put_content_type ({HTTP_MIME_TYPES}.text_csv) end
|
put_content_type_text_csv do put_content_type ({HTTP_MIME_TYPES}.text_csv) end
|
||||||
put_content_type_text_html do put_content_type ({HTTP_MIME_TYPES}.text_html) end
|
put_content_type_text_html do put_content_type ({HTTP_MIME_TYPES}.text_html) end
|
||||||
|
put_content_type_utf_8_text_html do put_content_type_with_charset ({HTTP_MIME_TYPES}.text_html, "utf-8") end
|
||||||
put_content_type_text_javascript do put_content_type ({HTTP_MIME_TYPES}.text_javascript) end
|
put_content_type_text_javascript do put_content_type ({HTTP_MIME_TYPES}.text_javascript) end
|
||||||
put_content_type_text_json do put_content_type ({HTTP_MIME_TYPES}.text_json) end
|
put_content_type_text_json do put_content_type ({HTTP_MIME_TYPES}.text_json) end
|
||||||
put_content_type_text_plain do put_content_type ({HTTP_MIME_TYPES}.text_plain) end
|
put_content_type_text_plain do put_content_type ({HTTP_MIME_TYPES}.text_plain) end
|
||||||
@@ -517,7 +518,7 @@ feature -- Others
|
|||||||
dt.second_add (a_seconds)
|
dt.second_add (a_seconds)
|
||||||
put_expires_date (dt)
|
put_expires_date (dt)
|
||||||
put_cache_control ("max-age=" + a_seconds.out)
|
put_cache_control ("max-age=" + a_seconds.out)
|
||||||
end
|
end
|
||||||
|
|
||||||
put_expires_string (a_expires: STRING)
|
put_expires_string (a_expires: STRING)
|
||||||
-- Put "Expires" header with `a_expires' string value
|
-- Put "Expires" header with `a_expires' string value
|
||||||
@@ -682,7 +683,7 @@ feature {NONE} -- Constants
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2014, Jocelyn Fiat, Eiffel Software and others"
|
copyright: "2011-2017, Jocelyn Fiat, 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
|
||||||
|
|||||||
@@ -460,7 +460,7 @@ feature -- Execution
|
|||||||
create h.make
|
create h.make
|
||||||
h.put_content_type_text_plain
|
h.put_content_type_text_plain
|
||||||
create s.make_empty
|
create s.make_empty
|
||||||
s.append ("Directory index: Access denied%N")
|
s.append ("Directory index %"" + uri + "%": Access denied%N")
|
||||||
res.set_status_code ({HTTP_STATUS_CODE}.forbidden)
|
res.set_status_code ({HTTP_STATUS_CODE}.forbidden)
|
||||||
h.put_content_length (s.count)
|
h.put_content_length (s.count)
|
||||||
res.put_header_lines (h)
|
res.put_header_lines (h)
|
||||||
@@ -642,7 +642,7 @@ feature {NONE} -- implementation: date time
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2016, 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
|
||||||
|
|||||||
Reference in New Issue
Block a user