WSF_REQUEST.content_type should keep only the relevant part of the content type
and forget about the eventual parameters (charset, name) ...
note: it is possible to query meta_string_variable ("CONTENT_TYPE")
to get the complete Content-Type header
This commit is contained in:
@@ -241,9 +241,11 @@ feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO
|
|||||||
-- Fill with variable from `a_vars'
|
-- Fill with variable from `a_vars'
|
||||||
local
|
local
|
||||||
s: like meta_string_variable
|
s: like meta_string_variable
|
||||||
|
s8: STRING_8
|
||||||
table: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]
|
table: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]
|
||||||
l_query_string: like query_string
|
l_query_string: like query_string
|
||||||
l_request_uri: detachable STRING_32
|
l_request_uri: detachable STRING_32
|
||||||
|
p: INTEGER
|
||||||
do
|
do
|
||||||
create {STRING_8} empty_string.make_empty
|
create {STRING_8} empty_string.make_empty
|
||||||
|
|
||||||
@@ -269,6 +271,15 @@ feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO
|
|||||||
--| CONTENT_TYPE
|
--| CONTENT_TYPE
|
||||||
s := meta_string_variable ({WGI_META_NAMES}.content_type)
|
s := meta_string_variable ({WGI_META_NAMES}.content_type)
|
||||||
if s /= Void and then not s.is_empty then
|
if s /= Void and then not s.is_empty then
|
||||||
|
p := s.index_of (';', 1)
|
||||||
|
if p > 0 then
|
||||||
|
s8 := s.substring (1, p - 1)
|
||||||
|
s8.right_adjust
|
||||||
|
s := s8
|
||||||
|
end
|
||||||
|
check
|
||||||
|
no_white_space: not has_white_space (s)
|
||||||
|
end
|
||||||
content_type := s
|
content_type := s
|
||||||
else
|
else
|
||||||
content_type := Void
|
content_type := Void
|
||||||
@@ -358,6 +369,12 @@ feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO
|
|||||||
|
|
||||||
feature {NONE} -- Implementation: utilities
|
feature {NONE} -- Implementation: utilities
|
||||||
|
|
||||||
|
has_white_space (s: READABLE_STRING_8): BOOLEAN
|
||||||
|
-- `s' has white space?
|
||||||
|
do
|
||||||
|
Result := s.has (' ') or else s.has ('%T')
|
||||||
|
end
|
||||||
|
|
||||||
single_slash_starting_string (s: READABLE_STRING_8): STRING_8
|
single_slash_starting_string (s: READABLE_STRING_8): STRING_8
|
||||||
-- Return the string `s' (or twin) with one and only one starting slash
|
-- Return the string `s' (or twin) with one and only one starting slash
|
||||||
local
|
local
|
||||||
|
|||||||
Reference in New Issue
Block a user