Skip to content

Commit c657d7c

Browse files
committed
Changes as requested.
1 parent ac2be35 commit c657d7c

3 files changed

Lines changed: 11 additions & 14 deletions

File tree

.rdoc_options

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
---
22
autolink_excluded_words:
33
- Rack
4+
- CGI

SPEC.rdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The remainder of the request URL's "path", designating the virtual "location" of
3434

3535
The <tt>PATH_INFO</tt>, if provided, must be a valid request target or an empty string, as defined by {RFC9110}[https://datatracker.ietf.org/doc/html/rfc9110#target.resource].
3636
* Only <tt>OPTIONS</tt> requests may have <tt>PATH_INFO</tt> set to <tt>*</tt> (asterisk-form).
37-
* Only <tt>CONNECT</tt> requests may have <tt>PATH_INFO</tt> set to an authority (authority-form). Note that in HTTP/2+, the authority-form is not a valid request target.
37+
* Only <tt>CONNECT</tt> requests may have <tt>PATH_INFO</tt> set to an authority (authority-form). Note that in <tt>HTTP/2+</tt>, the authority-form is not a valid request target.
3838
* <tt>CONNECT</tt> and <tt>OPTIONS</tt> requests must not have <tt>PATH_INFO</tt> set to a URI (absolute-form).
3939
* Otherwise, <tt>PATH_INFO</tt> must start with a <tt>/</tt> and must not include a fragment part starting with <tt>#</tt> (origin-form).
4040

@@ -149,8 +149,8 @@ The input stream is an +IO+-like object which contains the raw HTTP request data
149149
* +read+ behaves like <tt>IO#read</tt>. Its signature is <tt>read([length, [buffer]])</tt>.
150150
* If given, +length+ must be a non-negative Integer (>= 0) or +nil+, and +buffer+ must be a +String+ and may not be +nil+.
151151
* If +length+ is given and not +nil+, then this method reads at most +length+ bytes from the input stream.
152-
* If +length+ is not given or +nil+, then this method reads all data until <tt>EOF</tt>.
153-
* When <tt>EOF</tt> is reached, this method returns +nil+ if +length+ is given and not +nil+, or +""+ if +length+ is not given or is +nil+.
152+
* If +length+ is not given or +nil+, then this method reads all data until EOF.
153+
* When EOF is reached, this method returns +nil+ if +length+ is given and not +nil+, or +""+ if +length+ is not given or is +nil+.
154154
* If +buffer+ is given, then the read data will be placed into +buffer+ instead of a newly created +String+.
155155
* +each+ must be called without arguments and only yield +String+ values.
156156
* +close+ can be called on the input stream to indicate that any remaining input is not needed.
@@ -205,9 +205,9 @@ This is an HTTP status. It must be an Integer greater than or equal to 100.
205205
The headers must be an unfrozen +Hash+. The header keys must be +String+ values. Special headers starting <tt>rack.</tt> are for communicating with the server, and must not be sent back to the client.
206206

207207
* The headers must not contain a <tt>"status"</tt> key.
208-
* Header keys must conform to {RFC7230}[https://tools.ietf.org/html/rfc7230] token specification, i.e. cannot contain non-printable ASCII, <tt>DQUOTE</tt> or <tt>(),/:;<=>?@[\]{}</tt>.
208+
* Header keys must conform to {RFC7230}[https://tools.ietf.org/html/rfc7230] token specification, i.e. cannot contain non-printable <tt>ASCII</tt>, <tt>DQUOTE</tt> or <tt>(),/:;<=>?@[\]{}</tt>.
209209
* Header keys must not contain uppercase <tt>ASCII</tt> characters (A-Z).
210-
* Header values must be either a +String+, or an +Array+ of +String+ values, such that each +String+ must not contain characters with an ASCII ordinal below 040 (32).
210+
* Header values must be either a +String+, or an +Array+ of +String+ values, such that each +String+ must not contain characters with an <tt>ASCII</tt> ordinal below <tt>040</tt> (32).
211211

212212
==== The <tt>content-type</tt> Header
213213

@@ -225,7 +225,7 @@ Setting this value informs the server that it should perform a connection upgrad
225225

226226
=== The Body
227227

228-
The Body is typically an +Array+ of +String+ values, an enumerable that yields +String+ values, a +Proc+, or a +File+-like object.
228+
The Body is typically an +Array+ of +String+ values, an enumerable that yields +String+ values, a +Proc+, or an +IO+-like object.
229229

230230
The Body must respond to +each+ or +call+. It may optionally respond to +to_path+ or +to_ary+. A Body that responds to +each+ is considered to be an Enumerable Body. A Body that responds to +call+ is considered to be a Streaming Body.
231231

lib/rack/lint.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ def call(env = nil)
5555

5656
# N.B. The empty `##` comments creates paragraphs in the output. A trailing "\" is used to escape the newline character, which combines the comments into a single paragraph.
5757
#
58-
# Formatting conventions for documentation:
59-
# - Use <tt> for: literal values, constants, method signatures, environment keys, technical terms, BNF symbols.
60-
# - Use + for: Ruby types, concepts, method names, class references.
61-
#
6258
## = Rack Specification
6359
##
6460
## This specification aims to formalize the Rack protocol. You can (and should) use +Rack::Lint+ to enforce it. When you develop middleware, be sure to test with +Rack::Lint+ to catch possible violations of this specification.
@@ -222,7 +218,7 @@ def check_environment(env)
222218
raise LintError, "Only CONNECT requests may have PATH_INFO set to an authority (authority-form)"
223219
end
224220
when REQUEST_PATH_ABSOLUTE_FORM
225-
## * <tt>CONNECT</tt> and <tt>OPTIONS</tt> requests must not have <tt>PATH_INFO</tt> set to a <tt>URI</tt> (absolute-form).
221+
## * <tt>CONNECT</tt> and <tt>OPTIONS</tt> requests must not have <tt>PATH_INFO</tt> set to a URI (absolute-form).
226222
if env[REQUEST_METHOD] == CONNECT || env[REQUEST_METHOD] == OPTIONS
227223
raise LintError, "CONNECT and OPTIONS requests must not have PATH_INFO set to a URI (absolute-form)"
228224
end
@@ -502,7 +498,7 @@ def initialize(input)
502498
@input = input
503499
end
504500

505-
## * +gets+ must be called without arguments and return a +String+, or +nil+ on <tt>EOF</tt>.
501+
## * +gets+ must be called without arguments and return a +String+, or +nil+ on EOF (end-of-file).
506502
def gets(*args)
507503
raise LintError, "rack.input#gets called with arguments" unless args.size == 0
508504

@@ -518,8 +514,8 @@ def gets(*args)
518514
## * +read+ behaves like <tt>IO#read</tt>. Its signature is <tt>read([length, [buffer]])</tt>.
519515
## * If given, +length+ must be a non-negative Integer (>= 0) or +nil+, and +buffer+ must be a +String+ and may not be +nil+.
520516
## * If +length+ is given and not +nil+, then this method reads at most +length+ bytes from the input stream.
521-
## * If +length+ is not given or +nil+, then this method reads all data until <tt>EOF</tt>.
522-
## * When <tt>EOF</tt> is reached, this method returns +nil+ if +length+ is given and not +nil+, or +""+ if +length+ is not given or is +nil+.
517+
## * If +length+ is not given or +nil+, then this method reads all data until EOF.
518+
## * When EOF is reached, this method returns +nil+ if +length+ is given and not +nil+, or +""+ if +length+ is not given or is +nil+.
523519
## * If +buffer+ is given, then the read data will be placed into +buffer+ instead of a newly created +String+.
524520
def read(*args)
525521
unless args.size <= 2

0 commit comments

Comments
 (0)