Introduce WSF_COMPRESSION and applied to WSF_*_WITH_COMPRESSION classes.

Modified the example to send the file with or without compression.
This commit is contained in:
Jocelyn Fiat
2017-09-01 18:59:18 +02:00
parent 267655d7bc
commit a7d0398ec6
6 changed files with 344 additions and 270 deletions

View File

@@ -104,6 +104,15 @@ feature {NONE} -- Initialization
feature -- Element change
set_content_type (a_content_type: detachable like content_type)
do
if a_content_type = Void then
get_content_type
else
content_type := a_content_type
end
end
set_max_age (sec: INTEGER)
do
header.put_cache_control ("max-age=" + sec.out)
@@ -227,6 +236,7 @@ feature {WSF_RESPONSE} -- Output
do
res.set_status_code (status_code)
if status_code = {HTTP_STATUS_CODE}.not_found then
-- File not found, then no more data.
else
res.put_header_text (header.string)
s := head