diff --git a/library/network/protocol/content_negotiation/src/variants/character_encoding_variant_results.e b/library/network/protocol/content_negotiation/src/variants/character_encoding_variant_results.e index c627332c..862507cd 100644 --- a/library/network/protocol/content_negotiation/src/variants/character_encoding_variant_results.e +++ b/library/network/protocol/content_negotiation/src/variants/character_encoding_variant_results.e @@ -23,7 +23,7 @@ feature -- Change Element set_variant_header -- Set variant header as `Accept-Charset' do - variant_header := "Accept-Charset" + variant_header := {HTTP_HEADER_NAMES}.header_accept_charset -- "Accept-Charset" end note diff --git a/library/network/protocol/content_negotiation/src/variants/compression_variant_results.e b/library/network/protocol/content_negotiation/src/variants/compression_variant_results.e index 9cc0f7ca..22d0893d 100644 --- a/library/network/protocol/content_negotiation/src/variants/compression_variant_results.e +++ b/library/network/protocol/content_negotiation/src/variants/compression_variant_results.e @@ -22,7 +22,7 @@ feature -- Change Element set_variant_header -- Set variant_header as `Accept-Encoding' do - variant_header := "Accept-Encoding" + variant_header := {HTTP_HEADER_NAMES}.header_accept_encoding -- "Accept-Encoding" end note diff --git a/library/network/protocol/content_negotiation/src/variants/language_variant_results.e b/library/network/protocol/content_negotiation/src/variants/language_variant_results.e index 178d718c..7bfb6059 100644 --- a/library/network/protocol/content_negotiation/src/variants/language_variant_results.e +++ b/library/network/protocol/content_negotiation/src/variants/language_variant_results.e @@ -15,17 +15,14 @@ inherit VARIANT_RESULTS - feature -- Change Element - set_variant_header -- Set variant header as 'Accept-Language' do - variant_header := "Accept-Language" + variant_header := {HTTP_HEADER_NAMES}.header_accept_language -- "Accept-Language" end - note copyright: "2011-2013, Javier Velilla, Jocelyn Fiat, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" diff --git a/library/network/protocol/content_negotiation/src/variants/media_type_variant_results.e b/library/network/protocol/content_negotiation/src/variants/media_type_variant_results.e index 27f46baa..988f8cad 100644 --- a/library/network/protocol/content_negotiation/src/variants/media_type_variant_results.e +++ b/library/network/protocol/content_negotiation/src/variants/media_type_variant_results.e @@ -3,7 +3,7 @@ note {MEDIA_TYPE_VARIANT_RESULTS}. Represent the media type results between client preferences and media type variants supported by the server.. If the server is unable to supports the requested Accept values, the server can build - a response with the list of supported representations + a response with the list of supported representations ]" date: "$Date$" revision: "$Revision$" @@ -15,16 +15,14 @@ inherit VARIANT_RESULTS - feature -- Change Element set_variant_header -- Set variant header as `Accept' do - variant_header := "Accept" + variant_header := {HTTP_HEADER_NAMES}.header_accept -- "Accept" end - note copyright: "2011-2013, Javier Velilla, Jocelyn Fiat, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" diff --git a/library/network/protocol/content_negotiation/src/variants/variant_results.e b/library/network/protocol/content_negotiation/src/variants/variant_results.e index 60467cc2..bb48cacf 100644 --- a/library/network/protocol/content_negotiation/src/variants/variant_results.e +++ b/library/network/protocol/content_negotiation/src/variants/variant_results.e @@ -18,11 +18,15 @@ feature -- Access -- is the current variant accepted? type: detachable READABLE_STRING_8 - -- the type could be: media type, language, chracter_sets and encoding. + -- Associated type, it could be: + -- media type + -- language + -- character_sets + -- encoding. feature {NONE} -- Implementation - accept_headers_set: ARRAY[READABLE_STRING_8] + accept_headers_set: ARRAY [READABLE_STRING_8] -- Set of valid accept headers headers note EIS:"name=Accept", "src=http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1", "protocol=uri" @@ -30,7 +34,12 @@ feature {NONE} -- Implementation EIS:"name=Accept-Encoding", "src=http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3", "protocol=uri" EIS:"name=Accept-Language", "src=http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4", "protocol=uri" once - Result:= <<"Accept","Accept-Language","Accept-Encoding","Accept-Charset">> + Result:= << + {HTTP_HEADER_NAMES}.header_accept, -- "Accept", + {HTTP_HEADER_NAMES}.header_accept_language, -- "Accept-Language", + {HTTP_HEADER_NAMES}.header_accept_encoding, -- "Accept-Encoding", + {HTTP_HEADER_NAMES}.header_accept_charset --"Accept-Charset" + >> Result.compare_objects end @@ -44,7 +53,6 @@ feature -- Status_Report feature -- Change Element - set_type (a_type: READABLE_STRING_8) -- Set `type' as `a_type' do