Improved redirect_now_custom to allow custom status code, custom header, and custom content

This commit is contained in:
Jocelyn Fiat
2012-02-01 10:57:52 +01:00
parent a1354136fa
commit 645b35590b
2 changed files with 41 additions and 22 deletions

View File

@@ -33,7 +33,8 @@ inherit
create
make,
make_with_count,
make_from_array
make_from_array,
make_from_header
convert
make_from_array ({ARRAY [TUPLE [key: READABLE_STRING_8; value: READABLE_STRING_8]]}),
@@ -54,6 +55,7 @@ feature {NONE} -- Initialization
end
make_from_array (a_headers: ARRAY [TUPLE [key: READABLE_STRING_8; value: READABLE_STRING_8]])
-- Create HEADER from array of pair (key,value)
do
if a_headers.is_empty then
make_with_count (0)
@@ -67,6 +69,20 @@ feature {NONE} -- Initialization
end
end
make_from_header (a_header: HTTP_HEADER)
-- Create Current from existing HEADER `a_header'
local
lst: like headers
do
lst := a_header.headers
make_with_count (lst.count)
across
lst as c
loop
add_header (c.item.string)
end
end
feature -- Recycle
recycle