Skip to content

Commit 0a46487

Browse files
authored
Regenerate SPEC (#2102)
It looks like this has been out of sync since additional assertions were [added][1] to `Rack::Lint` concerning `SERVER_PORT`, `SERVER_NAME`, and `HTTP_HOST`. [1]: 290523f
1 parent cee73b3 commit 0a46487

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

SPEC.rdoc

+9-5
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,18 @@ below.
4242
<tt>QUERY_STRING</tt>:: The portion of the request URL that
4343
follows the <tt>?</tt>, if any. May be
4444
empty, but is always required!
45-
<tt>SERVER_NAME</tt>, <tt>SERVER_PORT</tt>::
46-
When combined with <tt>SCRIPT_NAME</tt> and
45+
<tt>SERVER_NAME</tt>:: When combined with <tt>SCRIPT_NAME</tt> and
4746
<tt>PATH_INFO</tt>, these variables can be
4847
used to complete the URL. Note, however,
4948
that <tt>HTTP_HOST</tt>, if present,
5049
should be used in preference to
5150
<tt>SERVER_NAME</tt> for reconstructing
5251
the request URL.
53-
<tt>SERVER_NAME</tt> and <tt>SERVER_PORT</tt>
54-
can never be empty strings, and so
55-
are always required.
52+
<tt>SERVER_NAME</tt> can never be an empty
53+
string, and so is always required.
54+
<tt>SERVER_PORT</tt>:: An optional +Integer+ which is the port the
55+
server is running on. Should be specified if
56+
the server is running on a non-standard port.
5657
<tt>HTTP_</tt> Variables:: Variables corresponding to the
5758
client-supplied HTTP request
5859
headers (i.e., variables whose
@@ -122,6 +123,9 @@ and should be prefixed uniquely. The prefix <tt>rack.</tt>
122123
is reserved for use with the Rack core distribution and other
123124
accepted specifications and must not be used otherwise.
124125

126+
The <tt>SERVER_PORT</tt> must be an Integer if set.
127+
The <tt>SERVER_NAME</tt> must be a valid authority as defined by RFC7540.
128+
The <tt>HTTP_HOST</tt> must be a valid authority as defined by RFC7540.
125129
The environment must not contain the keys
126130
<tt>HTTP_CONTENT_TYPE</tt> or <tt>HTTP_CONTENT_LENGTH</tt>
127131
(use the versions without <tt>HTTP_</tt>).

0 commit comments

Comments
 (0)