Use double quotes only when needed for put_content_type_with_parameters.
This commit is contained in:
@@ -213,6 +213,7 @@ feature -- Content related header
|
|||||||
--| note: see `put_content_type_with_charset' for examples.
|
--| note: see `put_content_type_with_charset' for examples.
|
||||||
local
|
local
|
||||||
s: STRING_8
|
s: STRING_8
|
||||||
|
v: READABLE_STRING_8
|
||||||
do
|
do
|
||||||
if a_params /= Void and then not a_params.is_empty then
|
if a_params /= Void and then not a_params.is_empty then
|
||||||
create s.make_from_string (a_content_type)
|
create s.make_from_string (a_content_type)
|
||||||
@@ -224,16 +225,21 @@ feature -- Content related header
|
|||||||
s.append_character (' ')
|
s.append_character (' ')
|
||||||
s.append (nv.name)
|
s.append (nv.name)
|
||||||
s.append_character ('=')
|
s.append_character ('=')
|
||||||
s.append_character ('%"')
|
v := nv.value
|
||||||
s.append (nv.value)
|
if v.has(' ') or v.has ('%T') or v.has ('=') then
|
||||||
s.append_character ('%"')
|
s.append_character ('%"')
|
||||||
|
s.append (v)
|
||||||
|
s.append_character ('%"')
|
||||||
|
else
|
||||||
|
s.append (v)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
put_header_key_value ({HTTP_HEADER_NAMES}.header_content_type, s)
|
put_header_key_value ({HTTP_HEADER_NAMES}.header_content_type, s)
|
||||||
else
|
else
|
||||||
put_content_type (a_content_type)
|
put_content_type (a_content_type)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
add_content_type_with_parameters (a_content_type: READABLE_STRING_8; a_params: detachable ARRAY [TUPLE [name: READABLE_STRING_8; value: READABLE_STRING_8]])
|
add_content_type_with_parameters (a_content_type: READABLE_STRING_8; a_params: detachable ARRAY [TUPLE [name: READABLE_STRING_8; value: READABLE_STRING_8]])
|
||||||
-- Add header line "Content-Type:" + type `a_content_type' and extra paramaters `a_params'.
|
-- Add header line "Content-Type:" + type `a_content_type' and extra paramaters `a_params'.
|
||||||
|
|||||||
Reference in New Issue
Block a user