Files
EWF/library/server/wsf/router/wsf_http_protocol_version.e
Jocelyn Fiat 30a5e087ae Web form:
- Improvement about web form manipulation (remove a field, set a text value to input fields by name, ...)
 - Improved web form html generation, especially for select and type checkbox
 - Updated the date input field interface with a new set_date_value .

File response:
 - "application/force-download" is not a standard MIME content type, so use "application_octet_stream" instead as default.

Standalone connector:
 - Added expected creation procedure for the service launcher.
 - Added new "secure_port" configuration variable, for SSL standalone service.
   This way, if `is_secure` is True, the server will use `secure_port` (overrides `port` value).

Date:
 - Improved support for RFC 3339 (a profile of ISO 8601)

Removed obsolete and warnings:
 - removed usage of FILE_NAME
 - updated code to avoid implicit conversion from STRING_32 to STRING_8
 - avoid uneed conversion to STRING_8 (when possible)
2020-10-02 15:02:06 +02:00

79 lines
2.0 KiB
Plaintext

note
description: "[
Parsed form of HTTP-Version field of request line.
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.1 for specification if the protocol is HTTP.
CGI 1.1 (not official specification) supports alternative protocols
and extension tokens. We do not currently recognise any of
these as valid.
date: "$Date$"
revision: "$Revision$"
]"
class WSF_HTTP_PROTOCOL_VERSION
create
make
feature {NONE} -- Initialization
make (a_protocol: READABLE_STRING_8)
-- Create by parsing `a_protocol'.
require
a_protocol_attached: a_protocol /= Void
local
l_tokens: LIST [READABLE_STRING_8]
l_protocol_name, l_protocol_version, l_major, l_minor: STRING_8
do
l_tokens := a_protocol.split ('/')
if l_tokens.count = 2 then
l_protocol_name := l_tokens [1].to_string_8
l_protocol_name.left_adjust
l_protocol_name.right_adjust
if l_protocol_name.is_case_insensitive_equal ({HTTP_CONSTANTS}.http_version_1_0.substring (1, 4)) then
l_protocol_version := l_tokens [2].to_string_8
l_protocol_version.left_adjust
l_protocol_version.right_adjust
l_tokens := l_protocol_version.split ('.')
if l_tokens.count = 2 then
l_major := l_tokens [1].to_string_8
l_major.left_adjust
l_major.right_adjust
l_minor := l_tokens [2].to_string_8
l_minor.left_adjust
l_minor.right_adjust
if l_major.is_natural then
major := l_major.to_natural
is_valid := True
-- We should be able to work with version 2
-- or greater by just functioning as HTTP/1.1
end
if l_minor.is_natural then
minor := l_minor.to_natural
end
end
end
end
end
feature -- Access
major: NATURAL
-- Major version of HTTP protocol;
-- Typically 1
minor: NATURAL
-- Major version of HTTP protocol;
-- Typically 1 or 0
feature -- Status report
is_valid: BOOLEAN
-- Was SERVER_PROTOCOL parsed successfully as HTTP?
end