added http_accept feature to represent "Accept:" HTTP header
This commit is contained in:
@@ -4,7 +4,7 @@ note
|
|||||||
Interface for a request environment
|
Interface for a request environment
|
||||||
It includes CGI interface and a few extra values that are usually valuable
|
It includes CGI interface and a few extra values that are usually valuable
|
||||||
|
|
||||||
See http://ken.coar.org/cgi/draft-coar-cgi-v11-03.txt
|
See http://www.ietf.org/rfc/rfc3875
|
||||||
|
|
||||||
2.2. Basic Rules
|
2.2. Basic Rules
|
||||||
|
|
||||||
@@ -12,77 +12,58 @@ note
|
|||||||
describe basic parsing constructs.
|
describe basic parsing constructs.
|
||||||
|
|
||||||
alpha = lowalpha | hialpha
|
alpha = lowalpha | hialpha
|
||||||
|
lowalpha = a | b | c | d | e | f | g | h |
|
||||||
|
i | j | k | l | m | n | o | p |
|
||||||
|
q | r | s | t | u | v | w | x |
|
||||||
|
y | z
|
||||||
|
hialpha = A | B | C | D | E | F | G | H |
|
||||||
|
I | J | K | L | M | N | O | P |
|
||||||
|
Q | R | S | T | U | V | W | X |
|
||||||
|
Y | Z
|
||||||
|
digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|
||||||
|
8 | 9
|
||||||
alphanum = alpha | digit
|
alphanum = alpha | digit
|
||||||
lowalpha = a | b | c | d | e | f | g | h
|
OCTET = <any 8-bit byte>
|
||||||
| i | j | k | l | m | n | o | p
|
CHAR = alpha | digit | separator | ! | # | $ |
|
||||||
| q | r | s | t | u | v | w | x
|
%% | & | ' | * | + | - | . | ` |
|
||||||
| y | z
|
^ | _ | { | | | } | ~ | CTL
|
||||||
hialpha = A | B | C | D | E | F | G | H
|
CTL = <any control character>
|
||||||
| I | J | K | L | M | N | O | P
|
SP = <space character>
|
||||||
| Q | R | S | T | U | V | W | X
|
HT = <horizontal tab character>
|
||||||
| Y | Z
|
NL = <newline>
|
||||||
digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
|
|
||||||
| 8 | 9
|
|
||||||
hex = digit | A | B | C | D | E | F | a
|
|
||||||
| b | c | d | e | f
|
|
||||||
escaped = % hex hex
|
|
||||||
OCTET = <any 8-bit sequence of data>
|
|
||||||
CHAR = <any US-ASCII character (octets 0 - 127)>
|
|
||||||
CTL = <any US-ASCII control character
|
|
||||||
(octets 0 - 31) and DEL (127)>
|
|
||||||
CR = <US-ASCII CR, carriage return (13)>
|
|
||||||
LF = <US-ASCII LF, linefeed (10)>
|
|
||||||
SP = <US-ASCII SP, space (32)>
|
|
||||||
HT = <US-ASCII HT, horizontal tab (9)>
|
|
||||||
NL = CR | LF
|
|
||||||
LWSP = SP | HT | NL
|
LWSP = SP | HT | NL
|
||||||
tspecial = ( | ) | "@" | , | ; | : | \ | "
|
separator = ( | ) | < | > | @ | , | ; | : |
|
||||||
| / | [ | ] | ? | < | > | { | }
|
\ | " | / | [ | ] | ? | = | { |
|
||||||
| SP | HT | NL
|
} | SP | HT
|
||||||
token = 1*<any CHAR except CTLs or tspecials>
|
token = 1*<any CHAR except CTLs or separators>
|
||||||
quoted-string = ( " *qdtext " ) | ( "<" *qatext ">")
|
quoted-string = " *qdtext "
|
||||||
qdtext = <any CHAR except %" and CTLs but including LWSP>
|
qdtext = <any CHAR except " and CTLs but including LWSP>
|
||||||
qatext = <any CHAR except "<", ">" and CTLs but including LWSP>
|
TEXT = <any printable character>
|
||||||
|
|
||||||
|
2.3. URL Encoding
|
||||||
|
|
||||||
|
reserved = ; | / | ? | : | @ | & | = | + | $ |
|
||||||
|
, | [ | ]
|
||||||
|
|
||||||
|
hex = digit | A | B | C | D | E | F | a | b
|
||||||
|
| c | d | e | f
|
||||||
|
escaped = "%%" hex hex
|
||||||
|
unreserved = alpha | digit | mark
|
||||||
mark = - | _ | . | ! | ~ | * | ' | ( | )
|
mark = - | _ | . | ! | ~ | * | ' | ( | )
|
||||||
unreserved = alphanum | mark
|
|
||||||
reserved = ; | / | ? | : | @ | & | = | $ | ,
|
|
||||||
uric = reserved | unreserved | escaped
|
|
||||||
|
|
||||||
Note that newline (NL) need not be a single character, but can
|
Note that newline (NL) need not be a single character, but can
|
||||||
be a character sequence.
|
be a character sequence.
|
||||||
|
|
||||||
3.2. The Script-URI
|
3.2. The Script-URI
|
||||||
|
|
||||||
The 'Script-URI' is defined as the URI of the resource
|
script-URI = <scheme> "://" <server-name> ":" <server-port>
|
||||||
identified by the metavariables. Often, this URI will be the
|
<script-path> <extra-path> "?" <query-string>
|
||||||
same as the URI requested by the client (the 'Client-URI');
|
|
||||||
however, it need not be. Instead, it could be a URI invented
|
|
||||||
by the server, and so it can only be used in the context of
|
|
||||||
the server and its CGI interface.
|
|
||||||
|
|
||||||
The Script-URI has the syntax of generic-RL as defined in
|
where <scheme> is found from SERVER_PROTOCOL, <server-name>,
|
||||||
section 2.1 of RFC 1808 [7], with the exception that object
|
<server-port> and <query-string> are the values of the respective
|
||||||
parameters and fragment identifiers are not permitted:
|
meta-variables. The SCRIPT_NAME and PATH_INFO values, URL-encoded
|
||||||
|
with ";", "=" and "?" reserved, give <script-path> and <extra-path>.
|
||||||
|
|
||||||
<scheme>://<host><port>/<path>?<query>
|
|
||||||
|
|
||||||
The various components of the Script-URI are defined by some
|
|
||||||
of the metavariables (see section 4 below);
|
|
||||||
|
|
||||||
script-uri = protocol "://" SERVER_NAME ":" SERVER_PORT enc-script
|
|
||||||
enc-path-info "?" QUERY_STRING
|
|
||||||
|
|
||||||
where 'protocol' is obtained from SERVER_PROTOCOL,
|
|
||||||
'enc-script' is a URL-encoded version of SCRIPT_NAME and
|
|
||||||
'enc-path-info' is a URL-encoded version of PATH_INFO. See
|
|
||||||
section 4.6 for more information about the PATH_INFO
|
|
||||||
metavariable.
|
|
||||||
|
|
||||||
Note that the scheme and the protocol are not identical; for
|
|
||||||
instance, a resource accessed via an SSL mechanism may have a
|
|
||||||
Client-URI with a scheme of "https" rather than "http".
|
|
||||||
CGI/1.1 provides no means for the script to reconstruct this,
|
|
||||||
and therefore the Script-URI includes the base protocol used.
|
|
||||||
]"
|
]"
|
||||||
legal: "See notice at end of class."
|
legal: "See notice at end of class."
|
||||||
status: "See notice at end of class."
|
status: "See notice at end of class."
|
||||||
@@ -518,6 +499,12 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
|
|
||||||
feature -- HTTP_*
|
feature -- HTTP_*
|
||||||
|
|
||||||
|
http_accept: detachable STRING
|
||||||
|
-- Contents of the Accept: header from the current request, if there is one.
|
||||||
|
-- Example: 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
http_accept_charset: detachable STRING
|
http_accept_charset: detachable STRING
|
||||||
-- Contents of the Accept-Charset: header from the current request, if there is one.
|
-- Contents of the Accept-Charset: header from the current request, if there is one.
|
||||||
-- Example: 'iso-8859-1,*,utf-8'.
|
-- Example: 'iso-8859-1,*,utf-8'.
|
||||||
|
|||||||
Reference in New Issue
Block a user