Use media_type as replacement for type_and_subtype_string in HTTP_CONTENT_TYPE
This commit is contained in:
@@ -199,7 +199,7 @@ feature -- Conversion
|
|||||||
do
|
do
|
||||||
res := internal_string
|
res := internal_string
|
||||||
if res = Void then
|
if res = Void then
|
||||||
create res.make_from_string (type_and_subtype_string)
|
create res.make_from_string (media_type)
|
||||||
if has_parameter then
|
if has_parameter then
|
||||||
res.append_character (';')
|
res.append_character (';')
|
||||||
res.append_character (' ')
|
res.append_character (' ')
|
||||||
@@ -214,13 +214,13 @@ feature -- Conversion
|
|||||||
Result := res
|
Result := res
|
||||||
end
|
end
|
||||||
|
|
||||||
type_and_subtype_string: READABLE_STRING_8
|
media_type: READABLE_STRING_8
|
||||||
-- String representation of type/subtype
|
-- String representation of type/subtype
|
||||||
local
|
local
|
||||||
res: like internal_type_and_subtype_string
|
res: like internal_media_type
|
||||||
s: like subtype
|
s: like subtype
|
||||||
do
|
do
|
||||||
res := internal_type_and_subtype_string
|
res := internal_media_type
|
||||||
if res = Void then
|
if res = Void then
|
||||||
create res.make_from_string (type)
|
create res.make_from_string (type)
|
||||||
s := subtype
|
s := subtype
|
||||||
@@ -230,7 +230,7 @@ feature -- Conversion
|
|||||||
res.append_character ('/')
|
res.append_character ('/')
|
||||||
res.append (s)
|
res.append (s)
|
||||||
end
|
end
|
||||||
internal_type_and_subtype_string := res
|
internal_media_type := res
|
||||||
end
|
end
|
||||||
Result := res
|
Result := res
|
||||||
end
|
end
|
||||||
@@ -239,7 +239,7 @@ feature {NONE} -- Internal
|
|||||||
|
|
||||||
internal_string: detachable STRING_8
|
internal_string: detachable STRING_8
|
||||||
|
|
||||||
internal_type_and_subtype_string: detachable STRING_8
|
internal_media_type: detachable STRING_8
|
||||||
|
|
||||||
feature -- Status report
|
feature -- Status report
|
||||||
|
|
||||||
@@ -256,9 +256,9 @@ feature -- Status report
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
same_type_and_subtype (s: READABLE_STRING_8): BOOLEAN
|
same_media_type (s: READABLE_STRING_8): BOOLEAN
|
||||||
do
|
do
|
||||||
Result := type_and_subtype_string.same_string (s)
|
Result := media_type.same_string (s)
|
||||||
end
|
end
|
||||||
|
|
||||||
same_string (s: READABLE_STRING_8): BOOLEAN
|
same_string (s: READABLE_STRING_8): BOOLEAN
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ feature -- Status report
|
|||||||
|
|
||||||
valid_content_type (a_content_type: HTTP_CONTENT_TYPE): BOOLEAN
|
valid_content_type (a_content_type: HTTP_CONTENT_TYPE): BOOLEAN
|
||||||
do
|
do
|
||||||
Result := a_content_type.same_type_and_subtype ({HTTP_MIME_TYPES}.application_x_www_form_encoded)
|
Result := a_content_type.same_media_type ({HTTP_MIME_TYPES}.application_x_www_form_encoded)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ feature -- Status report
|
|||||||
|
|
||||||
valid_content_type (a_content_type: HTTP_CONTENT_TYPE): BOOLEAN
|
valid_content_type (a_content_type: HTTP_CONTENT_TYPE): BOOLEAN
|
||||||
do
|
do
|
||||||
Result := a_content_type.same_type_and_subtype ({HTTP_MIME_TYPES}.multipart_form_data)
|
Result := a_content_type.same_media_type ({HTTP_MIME_TYPES}.multipart_form_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|||||||
Reference in New Issue
Block a user