Accepts "*" as valid media type (interpreted as */* to be flexible)

This commit is contained in:
2013-09-16 22:33:18 +02:00
parent 2f3a462c42
commit fff08a29e7
2 changed files with 13 additions and 2 deletions

View File

@@ -97,9 +97,16 @@ feature {NONE} -- Initialization
-- Extract type and subtype
p := t.index_of ('/', 1)
if p = 0 then
has_error := True
t.right_adjust
type := t
subtype := ""
if t.same_string ("*") then
-- Flexible parser allowing "*" even if this is not really a valid media-type
-- let's interpret it as "*/*"
subtype := "*"
else
has_error := True
subtype := "*"
end
else
subtype := t.substring (p + 1, t.count)
type := t