88 lines
1.9 KiB
Plaintext
88 lines
1.9 KiB
Plaintext
note
|
|
description: "Summary description for {WSF_FILE_RESPONSE_WITH_COMPRESSION}."
|
|
author: ""
|
|
date: "$Date$"
|
|
revision: "$Revision$"
|
|
|
|
class
|
|
WSF_FILE_RESPONSE_WITH_COMPRESSION
|
|
|
|
inherit
|
|
WSF_FILE_RESPONSE
|
|
redefine
|
|
send_to,
|
|
initialize
|
|
end
|
|
|
|
create
|
|
make_with_path,
|
|
make_with_content_type_and_path,
|
|
make_html_with_path,
|
|
make,
|
|
make_with_content_type,
|
|
make_html
|
|
|
|
feature {NONE} -- Initialization
|
|
|
|
initialize
|
|
do
|
|
Precursor
|
|
create compression.make
|
|
end
|
|
|
|
feature -- Access
|
|
|
|
compression: WSF_COMPRESSION
|
|
|
|
compression_variants: detachable HTTP_ACCEPT_ENCODING_VARIANTS
|
|
|
|
feature -- Compression setting
|
|
|
|
apply_compression (req: WSF_REQUEST)
|
|
do
|
|
compression_variants := compression.encoding_variants (req, content_type)
|
|
end
|
|
|
|
feature {WSF_RESPONSE} -- Output
|
|
|
|
send_to (res: WSF_RESPONSE)
|
|
local
|
|
s: detachable READABLE_STRING_8
|
|
do
|
|
if attached compression_variants as l_compression_variants and then
|
|
attached l_compression_variants.encoding as l_encoding and then
|
|
attached l_compression_variants.vary_header_value as l_vary_header
|
|
then
|
|
Precursor (res)
|
|
else
|
|
Precursor (res)
|
|
-- res.set_status_code (status_code)
|
|
-- if status_code = {HTTP_STATUS_CODE}.not_found then
|
|
-- else
|
|
-- res.put_header_text (header.string)
|
|
-- s := head
|
|
-- if s /= Void then
|
|
-- res.put_string (s)
|
|
-- end
|
|
-- if not answer_head_request_method then
|
|
-- send_file_content_to (file_path, res)
|
|
-- end
|
|
-- s := bottom
|
|
-- if s /= Void then
|
|
-- res.put_string (s)
|
|
-- end
|
|
-- end
|
|
end
|
|
end
|
|
note
|
|
copyright: "2011-2016, 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)"
|
|
source: "[
|
|
Eiffel Software
|
|
5949 Hollister Ave., Goleta, CA 93117 USA
|
|
Telephone 805-685-1006, Fax 805-685-6869
|
|
Website http://www.eiffel.com
|
|
Customer support http://support.eiffel.com
|
|
]"
|
|
end
|