Merge branch 'master' into handler

This commit is contained in:
Colin Adams
2013-05-10 09:27:23 +01:00
9 changed files with 398 additions and 54 deletions

View File

@@ -45,6 +45,7 @@ feature {NONE} -- Initialization
initialize
local
h: like header
d: HTTP_DATE
do
create h.make
header := h
@@ -52,6 +53,9 @@ feature {NONE} -- Initialization
h.put_transfer_encoding_binary
h.put_content_length (filesize (file_name))
h.put_content_disposition ("attachment", "filename=%""+ base_name +"%"")
if attached filedate (file_name) as dt then
h.put_last_modified (dt)
end
end
feature -- Element change
@@ -138,6 +142,19 @@ feature {NONE} -- Implementation: file system helper
end
end
filedate (fn: STRING): detachable DATE_TIME
-- Size of the file `fn'.
local
f: RAW_FILE
d: HTTP_DATE
do
create f.make (fn)
if f.exists then
create d.make_from_timestamp (f.date)
Result := d.date_time
end
end
file_extension (fn: STRING): STRING
-- Extension of file `fn'.
local

View File

@@ -207,7 +207,7 @@ feature -- Header output operation
if header_committed then
report_content_already_sent_and_header_ignored
else
header.append_raw_header_data (a_text)
header.put_raw_header_data (a_text)
end
ensure
message_writable: message_writable