Added HTTP_MEDIA_TYPE (maybe it will just replace the HTTP_CONTENT_TYPE later)

renamed .media_type as .simple_type for now
  allow more than one parameters
This commit is contained in:
Jocelyn Fiat
2012-03-23 18:39:19 +01:00
parent 5c98d7ba4e
commit bcccfb22ed
4 changed files with 351 additions and 294 deletions

View File

@@ -62,7 +62,7 @@ feature {NONE} -- Implementation: Form analyzer
is_crlf: BOOLEAN
do
l_boundary := a_content_type.parameter ("boundary")
if l_boundary /= Void then
if l_boundary /= Void and then not l_boundary.is_empty then
p := s.substring_index (l_boundary, 1)
if p > 1 then
l_boundary_prefix := s.substring (1, p - 1)

View File

@@ -48,8 +48,8 @@ feature -- Tests
["PATH_INFO", "/foo"]
>>
create ct.make_from_content_type_header ({HTTP_MIME_TYPES}.multipart_form_data)
ct.set_parameter ("boundary", "__=_the_boundary_1332296477_1804289383_=__")
create ct.make_from_string ({HTTP_MIME_TYPES}.multipart_form_data)
ct.add_parameter ("boundary", "__=_the_boundary_1332296477_1804289383_=__")
create h.make
h.put_content_type (ct)
@@ -64,7 +64,7 @@ Content-Disposition: form-data; name="password"
EWFpassword
--__=_the_boundary_1332296477_1804289383_=__--
]"
h.put_content_length (b.count)
--| Case #1