m2m_keygen 0.4.9 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.overcommit.yml +4 -7
- data/.rubocop.yml +19 -16
- data/.ruby-version +1 -1
- data/.streerc +1 -0
- data/.tool-versions +1 -1
- data/CHANGELOG.md +60 -1
- data/Gemfile +2 -2
- data/Gemfile.lock +135 -158
- data/README.md +64 -78
- data/docs/MIGRATING.md +69 -0
- data/docs/SPEC.md +245 -0
- data/examples/nonce_store/postgres.rb +40 -0
- data/examples/nonce_store/redis.rb +23 -0
- data/gemfiles/rack_2.gemfile +5 -0
- data/gemfiles/rack_3.gemfile +5 -0
- data/lib/m2m_keygen/canonicalizer.rb +57 -0
- data/lib/m2m_keygen/nonce_store/disabled.rb +19 -0
- data/lib/m2m_keygen/nonce_store/memory.rb +64 -0
- data/lib/m2m_keygen/nonce_store.rb +18 -0
- data/lib/m2m_keygen/rack_validator.rb +72 -19
- data/lib/m2m_keygen/request_signer/signed_request.rb +10 -0
- data/lib/m2m_keygen/request_signer.rb +118 -0
- data/lib/m2m_keygen/signature.rb +41 -39
- data/lib/m2m_keygen/types/params_type.rb +6 -17
- data/lib/m2m_keygen/version.rb +1 -1
- data/lib/m2m_keygen.rb +6 -0
- data/m2m_keygen.gemspec +12 -14
- data/sorbet/config +1 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/{ast@2.4.2.rbi → ast@2.4.3.rbi} +45 -79
- data/sorbet/rbi/gems/{benchmark@0.2.0.rbi → benchmark@0.5.0.rbi} +91 -58
- data/sorbet/rbi/gems/bundler-audit@0.9.3.rbi +397 -0
- data/sorbet/rbi/gems/byebug@13.0.0.rbi +3651 -0
- data/sorbet/rbi/gems/childprocess@5.1.0.rbi +336 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.3.7.rbi +384 -0
- data/sorbet/rbi/gems/{diff-lcs@1.5.0.rbi → diff-lcs@1.6.2.rbi} +189 -199
- data/sorbet/rbi/gems/{docile@1.4.0.rbi → docile@1.4.1.rbi} +147 -147
- data/sorbet/rbi/gems/dotenv@3.2.0.rbi +267 -0
- data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
- data/sorbet/rbi/gems/{faker@2.22.0.rbi → faker@3.8.0.rbi} +8468 -3829
- data/sorbet/rbi/gems/{ffi@1.15.5.rbi → ffi@1.17.4.rbi} +1 -0
- data/sorbet/rbi/gems/{formatador@1.1.0.rbi → formatador@1.2.3.rbi} +1 -0
- data/sorbet/rbi/gems/{guard@2.18.0.rbi → guard@2.20.1.rbi} +1 -0
- data/sorbet/rbi/gems/{i18n@1.12.0.rbi → i18n@1.15.2.rbi} +687 -827
- data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
- data/sorbet/rbi/gems/{json@2.6.2.rbi → json@2.20.0.rbi} +994 -252
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
- data/sorbet/rbi/gems/listen@3.10.0.rbi +9 -0
- data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
- data/sorbet/rbi/gems/{lumberjack@1.2.8.rbi → lumberjack@1.4.2.rbi} +1 -0
- data/sorbet/rbi/gems/{method_source@1.0.0.rbi → method_source@1.1.0.rbi} +111 -90
- data/sorbet/rbi/gems/{overcommit@0.59.1.rbi → overcommit@0.71.0.rbi} +503 -647
- data/sorbet/rbi/gems/parallel@2.1.0.rbi +321 -0
- data/sorbet/rbi/gems/parser@3.3.11.1.rbi +5229 -0
- data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +878 -0
- data/sorbet/rbi/gems/prism@1.9.0.rbi +42224 -0
- data/sorbet/rbi/gems/pry-byebug@3.12.0.rbi +481 -0
- data/sorbet/rbi/gems/{pry@0.14.1.rbi → pry@0.16.0.rbi} +2567 -3550
- data/sorbet/rbi/gems/{racc@1.6.0.rbi → racc@1.8.1.rbi} +54 -40
- data/sorbet/rbi/gems/rack@3.2.6.rbi +4653 -0
- data/sorbet/rbi/gems/{rake@13.0.6.rbi → rake@13.4.2.rbi} +963 -732
- data/sorbet/rbi/gems/{rb-inotify@0.10.1.rbi → rb-inotify@0.11.1.rbi} +1 -0
- data/sorbet/rbi/gems/rbi@0.3.14.rbi +5519 -0
- data/sorbet/rbi/gems/rbs@4.0.3.rbi +6908 -0
- data/sorbet/rbi/gems/regexp_parser@2.12.0.rbi +3398 -0
- data/sorbet/rbi/gems/reline@0.6.3.rbi +2446 -0
- data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
- data/sorbet/rbi/gems/{rexml@3.2.5.rbi → rexml@3.4.4.rbi} +1085 -894
- data/sorbet/rbi/gems/rspec-core@3.13.6.rbi +9475 -0
- data/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi +6108 -0
- data/sorbet/rbi/gems/rspec-mocks@3.13.8.rbi +4787 -0
- data/sorbet/rbi/gems/rspec-support@3.13.7.rbi +1274 -0
- data/sorbet/rbi/gems/rspec@3.13.2.rbi +15 -0
- data/sorbet/rbi/gems/rspec_in_context@1.2.2.rbi +294 -0
- data/sorbet/rbi/gems/rubocop-ast@1.49.1.rbi +7140 -0
- data/sorbet/rbi/gems/rubocop-faker@1.3.0.rbi +88 -0
- data/sorbet/rbi/gems/rubocop-performance@1.26.1.rbi +3403 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.12.0.rbi +2448 -0
- data/sorbet/rbi/gems/rubocop@1.88.1.rbi +63103 -0
- data/sorbet/rbi/gems/ruby-lsp@0.26.9.rbi +28 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
- data/sorbet/rbi/gems/rubydex@0.2.7.rbi +836 -0
- data/sorbet/rbi/gems/simplecov-html@0.13.2.rbi +90 -0
- data/sorbet/rbi/gems/{simplecov@0.21.2.rbi → simplecov@0.22.0.rbi} +438 -578
- data/sorbet/rbi/gems/spoom@1.8.2.rbi +6691 -0
- data/sorbet/rbi/gems/syntax_tree@6.3.0.rbi +22090 -0
- data/sorbet/rbi/gems/tapioca@0.19.2.rbi +3597 -0
- data/sorbet/rbi/gems/{thor@1.2.1.rbi → thor@1.5.0.rbi} +1085 -1171
- data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
- data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +130 -0
- data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +332 -0
- data/sorbet/rbi/gems/{yard-sorbet@0.7.0.rbi → yard-sorbet@0.9.0.rbi} +142 -99
- data/sorbet/rbi/gems/{yard@0.9.28.rbi → yard@0.9.44.rbi} +5350 -6316
- data/sorbet/rbi/gems/zeitwerk@2.8.2.rbi +1178 -0
- metadata +105 -111
- data/.prettierrc.js +0 -4
- data/docs/M2mKeygen/Error.html +0 -135
- data/docs/M2mKeygen/ParamsEncoder.html +0 -321
- data/docs/M2mKeygen/RackValidator.html +0 -533
- data/docs/M2mKeygen/Signature.html +0 -680
- data/docs/M2mKeygen/Types.html +0 -147
- data/docs/M2mKeygen.html +0 -157
- data/docs/_index.html +0 -182
- data/docs/class_list.html +0 -51
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -58
- data/docs/css/style.css +0 -497
- data/docs/file.README.html +0 -230
- data/docs/file_list.html +0 -56
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -230
- data/docs/js/app.js +0 -314
- data/docs/js/full_list.js +0 -216
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -139
- data/docs/top-level-namespace.html +0 -110
- data/lib/m2m_keygen/params_encoder.rb +0 -56
- data/package.json +0 -12
- data/sig/m2m_keygen.rbs +0 -4
- data/sorbet/rbi/gems/activesupport@7.0.3.1.rbi +0 -18608
- data/sorbet/rbi/gems/backport@1.2.0.rbi +0 -522
- data/sorbet/rbi/gems/bundler-audit@0.9.1.rbi +0 -308
- data/sorbet/rbi/gems/byebug@11.1.3.rbi +0 -3603
- data/sorbet/rbi/gems/childprocess@4.1.0.rbi +0 -401
- data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +0 -11581
- data/sorbet/rbi/gems/dotenv@2.8.1.rbi +0 -234
- data/sorbet/rbi/gems/e2mmap@0.1.0.rbi +0 -8
- data/sorbet/rbi/gems/haml@5.2.2.rbi +0 -3190
- data/sorbet/rbi/gems/jaro_winkler@1.5.4.rbi +0 -19
- data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +0 -133
- data/sorbet/rbi/gems/kramdown@2.4.0.rbi +0 -3261
- data/sorbet/rbi/gems/listen@3.7.1.rbi +0 -1181
- data/sorbet/rbi/gems/minitest@5.16.3.rbi +0 -1459
- data/sorbet/rbi/gems/nokogiri@1.13.8.rbi +0 -6514
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +0 -277
- data/sorbet/rbi/gems/parser@3.1.2.1.rbi +0 -6826
- data/sorbet/rbi/gems/prettier@3.2.0.rbi +0 -22
- data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +0 -8
- data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +0 -1222
- data/sorbet/rbi/gems/rack@2.2.4.rbi +0 -5630
- data/sorbet/rbi/gems/rbi@0.0.15.rbi +0 -3007
- data/sorbet/rbi/gems/rbs@2.6.0.rbi +0 -8
- data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +0 -3366
- data/sorbet/rbi/gems/reverse_markdown@2.1.1.rbi +0 -389
- data/sorbet/rbi/gems/rspec-core@3.11.0.rbi +0 -10786
- data/sorbet/rbi/gems/rspec-expectations@3.11.0.rbi +0 -8170
- data/sorbet/rbi/gems/rspec-mocks@3.11.1.rbi +0 -5385
- data/sorbet/rbi/gems/rspec-support@3.11.0.rbi +0 -1746
- data/sorbet/rbi/gems/rspec@3.11.0.rbi +0 -187
- data/sorbet/rbi/gems/rspec_in_context@1.1.0.3.rbi +0 -1113
- data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +0 -7044
- data/sorbet/rbi/gems/rubocop-faker@1.1.0.rbi +0 -106
- data/sorbet/rbi/gems/rubocop-performance@1.14.3.rbi +0 -2982
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +0 -990
- data/sorbet/rbi/gems/rubocop@1.35.1.rbi +0 -52002
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +0 -1239
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +0 -219
- data/sorbet/rbi/gems/solargraph@0.46.0.rbi +0 -9075
- data/sorbet/rbi/gems/spoom@1.1.12.rbi +0 -2369
- data/sorbet/rbi/gems/syntax_tree-haml@1.3.1.rbi +0 -8
- data/sorbet/rbi/gems/syntax_tree-rbs@0.5.0.rbi +0 -8
- data/sorbet/rbi/gems/syntax_tree@3.5.0.rbi +0 -8
- data/sorbet/rbi/gems/tapioca@0.9.4.rbi +0 -2946
- data/sorbet/rbi/gems/temple@0.8.2.rbi +0 -1712
- data/sorbet/rbi/gems/tilt@2.0.11.rbi +0 -742
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +0 -5914
- data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +0 -48
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -4529
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -2553
- data/sorbet/rbi/gems/zeitwerk@2.6.0.rbi +0 -867
- data/sorbet/rbi/manual.rbi +0 -7
- data/yarn.lock +0 -20
|
@@ -0,0 +1,4653 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
# DO NOT EDIT MANUALLY
|
|
4
|
+
# This is an autogenerated file for types exported from the `rack` gem.
|
|
5
|
+
# Please instead update this file by running `bin/tapioca gem rack`.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Copyright (C) 2007-2019 Leah Neukirchen <http://leahneukirchen.org/infopage.html>
|
|
9
|
+
#
|
|
10
|
+
# Rack is freely distributable under the terms of an MIT-style license.
|
|
11
|
+
# See MIT-LICENSE or https://opensource.org/licenses/MIT.
|
|
12
|
+
#
|
|
13
|
+
# pkg:gem/rack#lib/rack/version.rb:8
|
|
14
|
+
module Rack
|
|
15
|
+
class << self
|
|
16
|
+
# Return the Rack release as a dotted string.
|
|
17
|
+
#
|
|
18
|
+
# pkg:gem/rack#lib/rack/version.rb:14
|
|
19
|
+
def release; end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# pkg:gem/rack#lib/rack.rb:59
|
|
24
|
+
module Rack::Auth; end
|
|
25
|
+
|
|
26
|
+
# Rack::Auth::AbstractHandler implements common authentication functionality.
|
|
27
|
+
#
|
|
28
|
+
# +realm+ should be set for all handlers.
|
|
29
|
+
#
|
|
30
|
+
# pkg:gem/rack#lib/rack/auth/abstract/handler.rb:11
|
|
31
|
+
class Rack::Auth::AbstractHandler
|
|
32
|
+
# pkg:gem/rack#lib/rack/auth/abstract/handler.rb:15
|
|
33
|
+
def initialize(app, realm = T.unsafe(nil), &authenticator); end
|
|
34
|
+
|
|
35
|
+
# pkg:gem/rack#lib/rack/auth/abstract/handler.rb:13
|
|
36
|
+
def realm; end
|
|
37
|
+
|
|
38
|
+
# pkg:gem/rack#lib/rack/auth/abstract/handler.rb:13
|
|
39
|
+
def realm=(_arg0); end
|
|
40
|
+
|
|
41
|
+
private
|
|
42
|
+
|
|
43
|
+
# pkg:gem/rack#lib/rack/auth/abstract/handler.rb:31
|
|
44
|
+
def bad_request; end
|
|
45
|
+
|
|
46
|
+
# pkg:gem/rack#lib/rack/auth/abstract/handler.rb:22
|
|
47
|
+
def unauthorized(www_authenticate = T.unsafe(nil)); end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# pkg:gem/rack#lib/rack/auth/abstract/request.rb:8
|
|
51
|
+
class Rack::Auth::AbstractRequest
|
|
52
|
+
# pkg:gem/rack#lib/rack/auth/abstract/request.rb:10
|
|
53
|
+
def initialize(env); end
|
|
54
|
+
|
|
55
|
+
# pkg:gem/rack#lib/rack/auth/abstract/request.rb:35
|
|
56
|
+
def params; end
|
|
57
|
+
|
|
58
|
+
# pkg:gem/rack#lib/rack/auth/abstract/request.rb:27
|
|
59
|
+
def parts; end
|
|
60
|
+
|
|
61
|
+
# pkg:gem/rack#lib/rack/auth/abstract/request.rb:19
|
|
62
|
+
def provided?; end
|
|
63
|
+
|
|
64
|
+
# pkg:gem/rack#lib/rack/auth/abstract/request.rb:14
|
|
65
|
+
def request; end
|
|
66
|
+
|
|
67
|
+
# pkg:gem/rack#lib/rack/auth/abstract/request.rb:31
|
|
68
|
+
def scheme; end
|
|
69
|
+
|
|
70
|
+
# pkg:gem/rack#lib/rack/auth/abstract/request.rb:23
|
|
71
|
+
def valid?; end
|
|
72
|
+
|
|
73
|
+
private
|
|
74
|
+
|
|
75
|
+
# pkg:gem/rack#lib/rack/auth/abstract/request.rb:44
|
|
76
|
+
def authorization_key; end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# pkg:gem/rack#lib/rack/auth/abstract/request.rb:42
|
|
80
|
+
Rack::Auth::AbstractRequest::AUTHORIZATION_KEYS = T.let(T.unsafe(nil), Array)
|
|
81
|
+
|
|
82
|
+
# Rack::Auth::Basic implements HTTP Basic Authentication, as per RFC 2617.
|
|
83
|
+
#
|
|
84
|
+
# Initialize with the Rack application that you want protecting,
|
|
85
|
+
# and a block that checks if a username and password pair are valid.
|
|
86
|
+
#
|
|
87
|
+
# pkg:gem/rack#lib/rack/auth/basic.rb:13
|
|
88
|
+
class Rack::Auth::Basic < ::Rack::Auth::AbstractHandler
|
|
89
|
+
# pkg:gem/rack#lib/rack/auth/basic.rb:15
|
|
90
|
+
def call(env); end
|
|
91
|
+
|
|
92
|
+
private
|
|
93
|
+
|
|
94
|
+
# pkg:gem/rack#lib/rack/auth/basic.rb:34
|
|
95
|
+
def challenge; end
|
|
96
|
+
|
|
97
|
+
# pkg:gem/rack#lib/rack/auth/basic.rb:38
|
|
98
|
+
def valid?(auth); end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# pkg:gem/rack#lib/rack/auth/basic.rb:42
|
|
102
|
+
class Rack::Auth::Basic::Request < ::Rack::Auth::AbstractRequest
|
|
103
|
+
# pkg:gem/rack#lib/rack/auth/basic.rb:43
|
|
104
|
+
def basic?; end
|
|
105
|
+
|
|
106
|
+
# pkg:gem/rack#lib/rack/auth/basic.rb:47
|
|
107
|
+
def credentials; end
|
|
108
|
+
|
|
109
|
+
# pkg:gem/rack#lib/rack/auth/basic.rb:51
|
|
110
|
+
def username; end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# pkg:gem/rack#lib/rack/builder.rb:6
|
|
114
|
+
Rack::BUILDER_TOPLEVEL_BINDING = T.let(T.unsafe(nil), Proc)
|
|
115
|
+
|
|
116
|
+
# Represents a 400 Bad Request error when input data fails to meet the
|
|
117
|
+
# requirements.
|
|
118
|
+
#
|
|
119
|
+
# pkg:gem/rack#lib/rack/bad_request.rb:6
|
|
120
|
+
module Rack::BadRequest; end
|
|
121
|
+
|
|
122
|
+
# Proxy for response bodies allowing calling a block when
|
|
123
|
+
# the response body is closed (after the response has been fully
|
|
124
|
+
# sent to the client).
|
|
125
|
+
#
|
|
126
|
+
# pkg:gem/rack#lib/rack/body_proxy.rb:7
|
|
127
|
+
class Rack::BodyProxy
|
|
128
|
+
# Set the response body to wrap, and the block to call when the
|
|
129
|
+
# response has been fully sent.
|
|
130
|
+
#
|
|
131
|
+
# pkg:gem/rack#lib/rack/body_proxy.rb:10
|
|
132
|
+
def initialize(body, &block); end
|
|
133
|
+
|
|
134
|
+
# If not already closed, close the wrapped body and
|
|
135
|
+
# then call the block the proxy was initialized with.
|
|
136
|
+
#
|
|
137
|
+
# pkg:gem/rack#lib/rack/body_proxy.rb:28
|
|
138
|
+
def close; end
|
|
139
|
+
|
|
140
|
+
# Whether the proxy is closed. The proxy starts as not closed,
|
|
141
|
+
# and becomes closed on the first call to close.
|
|
142
|
+
#
|
|
143
|
+
# pkg:gem/rack#lib/rack/body_proxy.rb:40
|
|
144
|
+
def closed?; end
|
|
145
|
+
|
|
146
|
+
# Delegate missing methods to the wrapped body.
|
|
147
|
+
#
|
|
148
|
+
# pkg:gem/rack#lib/rack/body_proxy.rb:45
|
|
149
|
+
def method_missing(method_name, *args, **_arg2, &block); end
|
|
150
|
+
|
|
151
|
+
private
|
|
152
|
+
|
|
153
|
+
# Return whether the wrapped body responds to the method.
|
|
154
|
+
#
|
|
155
|
+
# pkg:gem/rack#lib/rack/body_proxy.rb:17
|
|
156
|
+
def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Rack::Builder provides a domain-specific language (DSL) to construct Rack
|
|
160
|
+
# applications. It is primarily used to parse +config.ru+ files which
|
|
161
|
+
# instantiate several middleware and a final application which are hosted
|
|
162
|
+
# by a Rack-compatible web server.
|
|
163
|
+
#
|
|
164
|
+
# Example:
|
|
165
|
+
#
|
|
166
|
+
# app = Rack::Builder.new do
|
|
167
|
+
# use Rack::CommonLogger
|
|
168
|
+
# map "/ok" do
|
|
169
|
+
# run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] }
|
|
170
|
+
# end
|
|
171
|
+
# end
|
|
172
|
+
#
|
|
173
|
+
# run app
|
|
174
|
+
#
|
|
175
|
+
# Or
|
|
176
|
+
#
|
|
177
|
+
# app = Rack::Builder.app do
|
|
178
|
+
# use Rack::CommonLogger
|
|
179
|
+
# run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] }
|
|
180
|
+
# end
|
|
181
|
+
#
|
|
182
|
+
# run app
|
|
183
|
+
#
|
|
184
|
+
# +use+ adds middleware to the stack, +run+ dispatches to an application.
|
|
185
|
+
# You can use +map+ to construct a Rack::URLMap in a convenient way.
|
|
186
|
+
#
|
|
187
|
+
# pkg:gem/rack#lib/rack/builder.rb:36
|
|
188
|
+
class Rack::Builder
|
|
189
|
+
# Initialize a new Rack::Builder instance. +default_app+ specifies the
|
|
190
|
+
# default application if +run+ is not called later. If a block
|
|
191
|
+
# is given, it is evaluated in the context of the instance.
|
|
192
|
+
#
|
|
193
|
+
# pkg:gem/rack#lib/rack/builder.rb:116
|
|
194
|
+
def initialize(default_app = T.unsafe(nil), **options, &block); end
|
|
195
|
+
|
|
196
|
+
# Call the Rack application generated by this builder instance. Note that
|
|
197
|
+
# this rebuilds the Rack application and runs the warmup code (if any)
|
|
198
|
+
# every time it is called, so it should not be used if performance is important.
|
|
199
|
+
#
|
|
200
|
+
# pkg:gem/rack#lib/rack/builder.rb:282
|
|
201
|
+
def call(env); end
|
|
202
|
+
|
|
203
|
+
# Freeze the app (set using run) and all middleware instances when building the application
|
|
204
|
+
# in to_app.
|
|
205
|
+
#
|
|
206
|
+
# pkg:gem/rack#lib/rack/builder.rb:265
|
|
207
|
+
def freeze_app; end
|
|
208
|
+
|
|
209
|
+
# Creates a route within the application. Routes under the mapped path will be sent to
|
|
210
|
+
# the Rack application specified by run inside the block. Other requests will be sent to the
|
|
211
|
+
# default application specified by run outside the block.
|
|
212
|
+
#
|
|
213
|
+
# class App
|
|
214
|
+
# def call(env)
|
|
215
|
+
# [200, {'content-type' => 'text/plain'}, ["Hello World"]]
|
|
216
|
+
# end
|
|
217
|
+
# end
|
|
218
|
+
#
|
|
219
|
+
# class Heartbeat
|
|
220
|
+
# def call(env)
|
|
221
|
+
# [200, { "content-type" => "text/plain" }, ["OK"]]
|
|
222
|
+
# end
|
|
223
|
+
# end
|
|
224
|
+
#
|
|
225
|
+
# app = Rack::Builder.app do
|
|
226
|
+
# map '/heartbeat' do
|
|
227
|
+
# run Heartbeat.new
|
|
228
|
+
# end
|
|
229
|
+
# run App.new
|
|
230
|
+
# end
|
|
231
|
+
#
|
|
232
|
+
# run app
|
|
233
|
+
#
|
|
234
|
+
# The +use+ method can also be used inside the block to specify middleware to run under a specific path:
|
|
235
|
+
#
|
|
236
|
+
# app = Rack::Builder.app do
|
|
237
|
+
# map '/heartbeat' do
|
|
238
|
+
# use Middleware
|
|
239
|
+
# run Heartbeat.new
|
|
240
|
+
# end
|
|
241
|
+
# run App.new
|
|
242
|
+
# end
|
|
243
|
+
#
|
|
244
|
+
# This example includes a piece of middleware which will run before +/heartbeat+ requests hit +Heartbeat+.
|
|
245
|
+
#
|
|
246
|
+
# Note that providing a +path+ of +/+ will ignore any default application given in a +run+ statement
|
|
247
|
+
# outside the block.
|
|
248
|
+
#
|
|
249
|
+
# pkg:gem/rack#lib/rack/builder.rb:256
|
|
250
|
+
def map(path, &block); end
|
|
251
|
+
|
|
252
|
+
# Any options provided to the Rack::Builder instance at initialization.
|
|
253
|
+
# These options can be server-specific. Some general options are:
|
|
254
|
+
#
|
|
255
|
+
# * +:isolation+: One of +process+, +thread+ or +fiber+. The execution
|
|
256
|
+
# isolation model to use.
|
|
257
|
+
#
|
|
258
|
+
# pkg:gem/rack#lib/rack/builder.rb:132
|
|
259
|
+
def options; end
|
|
260
|
+
|
|
261
|
+
# Takes a block or argument that is an object that responds to #call and
|
|
262
|
+
# returns a Rack response.
|
|
263
|
+
#
|
|
264
|
+
# You can use a block:
|
|
265
|
+
#
|
|
266
|
+
# run do |env|
|
|
267
|
+
# [200, { "content-type" => "text/plain" }, ["Hello World!"]]
|
|
268
|
+
# end
|
|
269
|
+
#
|
|
270
|
+
# You can also provide a lambda:
|
|
271
|
+
#
|
|
272
|
+
# run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] }
|
|
273
|
+
#
|
|
274
|
+
# You can also provide a class instance:
|
|
275
|
+
#
|
|
276
|
+
# class Heartbeat
|
|
277
|
+
# def call(env)
|
|
278
|
+
# [200, { "content-type" => "text/plain" }, ["OK"]]
|
|
279
|
+
# end
|
|
280
|
+
# end
|
|
281
|
+
#
|
|
282
|
+
# run Heartbeat.new
|
|
283
|
+
#
|
|
284
|
+
# pkg:gem/rack#lib/rack/builder.rb:195
|
|
285
|
+
def run(app = T.unsafe(nil), &block); end
|
|
286
|
+
|
|
287
|
+
# Return the Rack application generated by this instance.
|
|
288
|
+
#
|
|
289
|
+
# pkg:gem/rack#lib/rack/builder.rb:270
|
|
290
|
+
def to_app; end
|
|
291
|
+
|
|
292
|
+
# Specifies middleware to use in a stack.
|
|
293
|
+
#
|
|
294
|
+
# class Middleware
|
|
295
|
+
# def initialize(app)
|
|
296
|
+
# @app = app
|
|
297
|
+
# end
|
|
298
|
+
#
|
|
299
|
+
# def call(env)
|
|
300
|
+
# env["rack.some_header"] = "setting an example"
|
|
301
|
+
# @app.call(env)
|
|
302
|
+
# end
|
|
303
|
+
# end
|
|
304
|
+
#
|
|
305
|
+
# use Middleware
|
|
306
|
+
# run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] }
|
|
307
|
+
#
|
|
308
|
+
# All requests through to this application will first be processed by the middleware class.
|
|
309
|
+
# The +call+ method in this example sets an additional environment key which then can be
|
|
310
|
+
# referenced in the application if required.
|
|
311
|
+
#
|
|
312
|
+
# pkg:gem/rack#lib/rack/builder.rb:159
|
|
313
|
+
def use(middleware, *args, **_arg2, &block); end
|
|
314
|
+
|
|
315
|
+
# Takes a lambda or block that is used to warm-up the application. This block is called
|
|
316
|
+
# before the Rack application is returned by to_app.
|
|
317
|
+
#
|
|
318
|
+
# warmup do |app|
|
|
319
|
+
# client = Rack::MockRequest.new(app)
|
|
320
|
+
# client.get('/')
|
|
321
|
+
# end
|
|
322
|
+
#
|
|
323
|
+
# use SomeMiddleware
|
|
324
|
+
# run MyApp
|
|
325
|
+
#
|
|
326
|
+
# pkg:gem/rack#lib/rack/builder.rb:213
|
|
327
|
+
def warmup(prc = T.unsafe(nil), &block); end
|
|
328
|
+
|
|
329
|
+
private
|
|
330
|
+
|
|
331
|
+
# Generate a URLMap instance by generating new Rack applications for each
|
|
332
|
+
# map block in this instance.
|
|
333
|
+
#
|
|
334
|
+
# pkg:gem/rack#lib/rack/builder.rb:290
|
|
335
|
+
def generate_map(default_app, mapping); end
|
|
336
|
+
|
|
337
|
+
class << self
|
|
338
|
+
# Create a new Rack::Builder instance and return the Rack application
|
|
339
|
+
# generated from it.
|
|
340
|
+
#
|
|
341
|
+
# pkg:gem/rack#lib/rack/builder.rb:136
|
|
342
|
+
def app(default_app = T.unsafe(nil), &block); end
|
|
343
|
+
|
|
344
|
+
# Load the given file as a rackup file, treating the
|
|
345
|
+
# contents as if specified inside a Rack::Builder block.
|
|
346
|
+
#
|
|
347
|
+
# Ignores content in the file after +__END__+, so that
|
|
348
|
+
# use of +__END__+ will not result in a syntax error.
|
|
349
|
+
#
|
|
350
|
+
# Example config.ru file:
|
|
351
|
+
#
|
|
352
|
+
# $ cat config.ru
|
|
353
|
+
#
|
|
354
|
+
# use Rack::ContentLength
|
|
355
|
+
# require './app.rb'
|
|
356
|
+
# run App
|
|
357
|
+
#
|
|
358
|
+
# pkg:gem/rack#lib/rack/builder.rb:87
|
|
359
|
+
def load_file(path, **options); end
|
|
360
|
+
|
|
361
|
+
# Evaluate the given +builder_script+ string in the context of
|
|
362
|
+
# a Rack::Builder block, returning a Rack application.
|
|
363
|
+
#
|
|
364
|
+
# pkg:gem/rack#lib/rack/builder.rb:102
|
|
365
|
+
def new_from_string(builder_script, path = T.unsafe(nil), **options); end
|
|
366
|
+
|
|
367
|
+
# Parse the given config file to get a Rack application.
|
|
368
|
+
#
|
|
369
|
+
# If the config file ends in +.ru+, it is treated as a
|
|
370
|
+
# rackup file and the contents will be treated as if
|
|
371
|
+
# specified inside a Rack::Builder block.
|
|
372
|
+
#
|
|
373
|
+
# If the config file does not end in +.ru+, it is
|
|
374
|
+
# required and Rack will use the basename of the file
|
|
375
|
+
# to guess which constant will be the Rack application to run.
|
|
376
|
+
#
|
|
377
|
+
# Examples:
|
|
378
|
+
#
|
|
379
|
+
# Rack::Builder.parse_file('config.ru')
|
|
380
|
+
# # Rack application built using Rack::Builder.new
|
|
381
|
+
#
|
|
382
|
+
# Rack::Builder.parse_file('app.rb')
|
|
383
|
+
# # requires app.rb, which can be anywhere in Ruby's
|
|
384
|
+
# # load path. After requiring, assumes App constant
|
|
385
|
+
# # is a Rack application
|
|
386
|
+
#
|
|
387
|
+
# Rack::Builder.parse_file('./my_app.rb')
|
|
388
|
+
# # requires ./my_app.rb, which should be in the
|
|
389
|
+
# # process's current directory. After requiring,
|
|
390
|
+
# # assumes MyApp constant is a Rack application
|
|
391
|
+
#
|
|
392
|
+
# pkg:gem/rack#lib/rack/builder.rb:65
|
|
393
|
+
def parse_file(path, **options); end
|
|
394
|
+
end
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
# https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom
|
|
398
|
+
#
|
|
399
|
+
# pkg:gem/rack#lib/rack/builder.rb:39
|
|
400
|
+
Rack::Builder::UTF_8_BOM = T.let(T.unsafe(nil), String)
|
|
401
|
+
|
|
402
|
+
# Response Header Keys
|
|
403
|
+
#
|
|
404
|
+
# pkg:gem/rack#lib/rack/constants.rb:19
|
|
405
|
+
Rack::CACHE_CONTROL = T.let(T.unsafe(nil), String)
|
|
406
|
+
|
|
407
|
+
# pkg:gem/rack#lib/rack/constants.rb:35
|
|
408
|
+
Rack::CONNECT = T.let(T.unsafe(nil), String)
|
|
409
|
+
|
|
410
|
+
# pkg:gem/rack#lib/rack/constants.rb:20
|
|
411
|
+
Rack::CONTENT_LENGTH = T.let(T.unsafe(nil), String)
|
|
412
|
+
|
|
413
|
+
# pkg:gem/rack#lib/rack/constants.rb:21
|
|
414
|
+
Rack::CONTENT_TYPE = T.let(T.unsafe(nil), String)
|
|
415
|
+
|
|
416
|
+
# Rack::Cascade tries a request on several apps, and returns the
|
|
417
|
+
# first response that is not 404 or 405 (or in a list of configured
|
|
418
|
+
# status codes). If all applications tried return one of the configured
|
|
419
|
+
# status codes, return the last response.
|
|
420
|
+
#
|
|
421
|
+
# pkg:gem/rack#lib/rack/cascade.rb:11
|
|
422
|
+
class Rack::Cascade
|
|
423
|
+
# Set the apps to send requests to, and what statuses result in
|
|
424
|
+
# cascading. Arguments:
|
|
425
|
+
#
|
|
426
|
+
# apps: An enumerable of rack applications.
|
|
427
|
+
# cascade_for: The statuses to use cascading for. If a response is received
|
|
428
|
+
# from an app, the next app is tried.
|
|
429
|
+
#
|
|
430
|
+
# pkg:gem/rack#lib/rack/cascade.rb:21
|
|
431
|
+
def initialize(apps, cascade_for = T.unsafe(nil)); end
|
|
432
|
+
|
|
433
|
+
# pkg:gem/rack#lib/rack/cascade.rb:65
|
|
434
|
+
def <<(app); end
|
|
435
|
+
|
|
436
|
+
# Append an app to the list of apps to cascade. This app will
|
|
437
|
+
# be tried last.
|
|
438
|
+
#
|
|
439
|
+
# pkg:gem/rack#lib/rack/cascade.rb:56
|
|
440
|
+
def add(app); end
|
|
441
|
+
|
|
442
|
+
# An array of applications to try in order.
|
|
443
|
+
#
|
|
444
|
+
# pkg:gem/rack#lib/rack/cascade.rb:13
|
|
445
|
+
def apps; end
|
|
446
|
+
|
|
447
|
+
# Call each app in order. If the responses uses a status that requires
|
|
448
|
+
# cascading, try the next app. If all responses require cascading,
|
|
449
|
+
# return the response from the last app.
|
|
450
|
+
#
|
|
451
|
+
# pkg:gem/rack#lib/rack/cascade.rb:32
|
|
452
|
+
def call(env); end
|
|
453
|
+
|
|
454
|
+
# Whether the given app is one of the apps to cascade to.
|
|
455
|
+
#
|
|
456
|
+
# pkg:gem/rack#lib/rack/cascade.rb:61
|
|
457
|
+
def include?(app); end
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
# Rack::CommonLogger forwards every request to the given +app+, and
|
|
461
|
+
# logs a line in the
|
|
462
|
+
# {Apache common log format}[http://httpd.apache.org/docs/1.3/logs.html#common]
|
|
463
|
+
# to the configured logger.
|
|
464
|
+
#
|
|
465
|
+
# pkg:gem/rack#lib/rack/common_logger.rb:13
|
|
466
|
+
class Rack::CommonLogger
|
|
467
|
+
# +logger+ can be any object that supports the +write+ or +<<+ methods,
|
|
468
|
+
# which includes the standard library Logger. These methods are called
|
|
469
|
+
# with a single string argument, the log message.
|
|
470
|
+
# If +logger+ is nil, CommonLogger will fall back <tt>env['rack.errors']</tt>.
|
|
471
|
+
#
|
|
472
|
+
# pkg:gem/rack#lib/rack/common_logger.rb:29
|
|
473
|
+
def initialize(app, logger = T.unsafe(nil)); end
|
|
474
|
+
|
|
475
|
+
# Log all requests in common_log format after a response has been
|
|
476
|
+
# returned. Note that if the app raises an exception, the request
|
|
477
|
+
# will not be logged, so if exception handling middleware are used,
|
|
478
|
+
# they should be loaded after this middleware. Additionally, because
|
|
479
|
+
# the logging happens after the request body has been fully sent, any
|
|
480
|
+
# exceptions raised during the sending of the response body will
|
|
481
|
+
# cause the request not to be logged.
|
|
482
|
+
#
|
|
483
|
+
# pkg:gem/rack#lib/rack/common_logger.rb:41
|
|
484
|
+
def call(env); end
|
|
485
|
+
|
|
486
|
+
private
|
|
487
|
+
|
|
488
|
+
# Attempt to determine the content length for the response to
|
|
489
|
+
# include it in the logged data.
|
|
490
|
+
#
|
|
491
|
+
# pkg:gem/rack#lib/rack/common_logger.rb:84
|
|
492
|
+
def extract_content_length(headers); end
|
|
493
|
+
|
|
494
|
+
# Log the request to the configured logger.
|
|
495
|
+
#
|
|
496
|
+
# pkg:gem/rack#lib/rack/common_logger.rb:52
|
|
497
|
+
def log(env, status, response_headers, began_at); end
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
# Common Log Format: http://httpd.apache.org/docs/1.3/logs.html#common
|
|
501
|
+
#
|
|
502
|
+
# lilith.local - - [07/Aug/2006 23:58:02 -0400] "GET / HTTP/1.1" 500 -
|
|
503
|
+
#
|
|
504
|
+
# %{%s - %s [%s] "%s %s%s %s" %d %s\n} %
|
|
505
|
+
#
|
|
506
|
+
# The actual format is slightly different than the above due to the
|
|
507
|
+
# separation of SCRIPT_NAME and PATH_INFO, and because the elapsed
|
|
508
|
+
# time in seconds is included at the end.
|
|
509
|
+
#
|
|
510
|
+
# pkg:gem/rack#lib/rack/common_logger.rb:23
|
|
511
|
+
Rack::CommonLogger::FORMAT = T.let(T.unsafe(nil), String)
|
|
512
|
+
|
|
513
|
+
# Middleware that enables conditional GET using if-none-match and
|
|
514
|
+
# if-modified-since. The application should set either or both of the
|
|
515
|
+
# last-modified or etag response headers according to RFC 2616. When
|
|
516
|
+
# either of the conditions is met, the response body is set to be zero
|
|
517
|
+
# length and the response status is set to 304 Not Modified.
|
|
518
|
+
#
|
|
519
|
+
# Applications that defer response body generation until the body's each
|
|
520
|
+
# message is received will avoid response body generation completely when
|
|
521
|
+
# a conditional GET matches.
|
|
522
|
+
#
|
|
523
|
+
# Adapted from Michael Klishin's Merb implementation:
|
|
524
|
+
# https://github.com/wycats/merb/blob/master/merb-core/lib/merb-core/rack/middleware/conditional_get.rb
|
|
525
|
+
#
|
|
526
|
+
# pkg:gem/rack#lib/rack/conditional_get.rb:21
|
|
527
|
+
class Rack::ConditionalGet
|
|
528
|
+
# pkg:gem/rack#lib/rack/conditional_get.rb:22
|
|
529
|
+
def initialize(app); end
|
|
530
|
+
|
|
531
|
+
# Return empty 304 response if the response has not been
|
|
532
|
+
# modified since the last request.
|
|
533
|
+
#
|
|
534
|
+
# pkg:gem/rack#lib/rack/conditional_get.rb:28
|
|
535
|
+
def call(env); end
|
|
536
|
+
|
|
537
|
+
private
|
|
538
|
+
|
|
539
|
+
# Whether the etag response header matches the if-none-match request header.
|
|
540
|
+
# If so, the request has not been modified.
|
|
541
|
+
#
|
|
542
|
+
# pkg:gem/rack#lib/rack/conditional_get.rb:63
|
|
543
|
+
def etag_matches?(none_match, headers); end
|
|
544
|
+
|
|
545
|
+
# Return whether the response has not been modified since the
|
|
546
|
+
# last request.
|
|
547
|
+
#
|
|
548
|
+
# pkg:gem/rack#lib/rack/conditional_get.rb:52
|
|
549
|
+
def fresh?(env, headers); end
|
|
550
|
+
|
|
551
|
+
# Whether the last-modified response header matches the if-modified-since
|
|
552
|
+
# request header. If so, the request has not been modified.
|
|
553
|
+
#
|
|
554
|
+
# pkg:gem/rack#lib/rack/conditional_get.rb:69
|
|
555
|
+
def modified_since?(modified_since, headers); end
|
|
556
|
+
|
|
557
|
+
# Return a Time object for the given string (which should be in RFC2822
|
|
558
|
+
# format), or nil if the string cannot be parsed.
|
|
559
|
+
#
|
|
560
|
+
# pkg:gem/rack#lib/rack/conditional_get.rb:76
|
|
561
|
+
def to_rfc2822(since); end
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
# Rack::Config modifies the environment using the block given during
|
|
565
|
+
# initialization.
|
|
566
|
+
#
|
|
567
|
+
# Example:
|
|
568
|
+
# use Rack::Config do |env|
|
|
569
|
+
# env['my-key'] = 'some-value'
|
|
570
|
+
# end
|
|
571
|
+
#
|
|
572
|
+
# pkg:gem/rack#lib/rack/config.rb:11
|
|
573
|
+
class Rack::Config
|
|
574
|
+
# pkg:gem/rack#lib/rack/config.rb:12
|
|
575
|
+
def initialize(app, &block); end
|
|
576
|
+
|
|
577
|
+
# pkg:gem/rack#lib/rack/config.rb:17
|
|
578
|
+
def call(env); end
|
|
579
|
+
end
|
|
580
|
+
|
|
581
|
+
# Sets the content-length header on responses that do not specify
|
|
582
|
+
# a content-length or transfer-encoding header. Note that this
|
|
583
|
+
# does not fix responses that have an invalid content-length
|
|
584
|
+
# header specified.
|
|
585
|
+
#
|
|
586
|
+
# pkg:gem/rack#lib/rack/content_length.rb:12
|
|
587
|
+
class Rack::ContentLength
|
|
588
|
+
include ::Rack::Utils
|
|
589
|
+
|
|
590
|
+
# pkg:gem/rack#lib/rack/content_length.rb:15
|
|
591
|
+
def initialize(app); end
|
|
592
|
+
|
|
593
|
+
# pkg:gem/rack#lib/rack/content_length.rb:19
|
|
594
|
+
def call(env); end
|
|
595
|
+
end
|
|
596
|
+
|
|
597
|
+
# Sets the content-type header on responses which don't have one.
|
|
598
|
+
#
|
|
599
|
+
# Builder Usage:
|
|
600
|
+
# use Rack::ContentType, "text/plain"
|
|
601
|
+
#
|
|
602
|
+
# When no content type argument is provided, "text/html" is the
|
|
603
|
+
# default.
|
|
604
|
+
#
|
|
605
|
+
# pkg:gem/rack#lib/rack/content_type.rb:15
|
|
606
|
+
class Rack::ContentType
|
|
607
|
+
include ::Rack::Utils
|
|
608
|
+
|
|
609
|
+
# pkg:gem/rack#lib/rack/content_type.rb:18
|
|
610
|
+
def initialize(app, content_type = T.unsafe(nil)); end
|
|
611
|
+
|
|
612
|
+
# pkg:gem/rack#lib/rack/content_type.rb:23
|
|
613
|
+
def call(env); end
|
|
614
|
+
end
|
|
615
|
+
|
|
616
|
+
# pkg:gem/rack#lib/rack/constants.rb:32
|
|
617
|
+
Rack::DELETE = T.let(T.unsafe(nil), String)
|
|
618
|
+
|
|
619
|
+
# This middleware enables content encoding of http responses,
|
|
620
|
+
# usually for purposes of compression.
|
|
621
|
+
#
|
|
622
|
+
# Currently supported encodings:
|
|
623
|
+
#
|
|
624
|
+
# * gzip
|
|
625
|
+
# * identity (no transformation)
|
|
626
|
+
#
|
|
627
|
+
# This middleware automatically detects when encoding is supported
|
|
628
|
+
# and allowed. For example no encoding is made when a cache
|
|
629
|
+
# directive of 'no-transform' is present, when the response status
|
|
630
|
+
# code is one that doesn't allow an entity body, or when the body
|
|
631
|
+
# is empty.
|
|
632
|
+
#
|
|
633
|
+
# Note that despite the name, Deflater does not support the +deflate+
|
|
634
|
+
# encoding.
|
|
635
|
+
#
|
|
636
|
+
# pkg:gem/rack#lib/rack/deflater.rb:28
|
|
637
|
+
class Rack::Deflater
|
|
638
|
+
# Creates Rack::Deflater middleware. Options:
|
|
639
|
+
#
|
|
640
|
+
# :if :: a lambda enabling / disabling deflation based on returned boolean value
|
|
641
|
+
# (e.g <tt>use Rack::Deflater, :if => lambda { |*, body| sum=0; body.each { |i| sum += i.length }; sum > 512 }</tt>).
|
|
642
|
+
# However, be aware that calling `body.each` inside the block will break cases where `body.each` is not idempotent,
|
|
643
|
+
# such as when it is an +IO+ instance.
|
|
644
|
+
# :include :: a list of content types that should be compressed. By default, all content types are compressed.
|
|
645
|
+
# :sync :: determines if the stream is going to be flushed after every chunk. Flushing after every chunk reduces
|
|
646
|
+
# latency for time-sensitive streaming applications, but hurts compression and throughput.
|
|
647
|
+
# Defaults to +true+.
|
|
648
|
+
#
|
|
649
|
+
# pkg:gem/rack#lib/rack/deflater.rb:39
|
|
650
|
+
def initialize(app, options = T.unsafe(nil)); end
|
|
651
|
+
|
|
652
|
+
# pkg:gem/rack#lib/rack/deflater.rb:46
|
|
653
|
+
def call(env); end
|
|
654
|
+
|
|
655
|
+
private
|
|
656
|
+
|
|
657
|
+
# Whether the body should be compressed.
|
|
658
|
+
#
|
|
659
|
+
# pkg:gem/rack#lib/rack/deflater.rb:136
|
|
660
|
+
def should_deflate?(env, status, headers, body); end
|
|
661
|
+
end
|
|
662
|
+
|
|
663
|
+
# Body class used for gzip encoded responses.
|
|
664
|
+
#
|
|
665
|
+
# pkg:gem/rack#lib/rack/deflater.rb:83
|
|
666
|
+
class Rack::Deflater::GzipStream
|
|
667
|
+
# Initialize the gzip stream. Arguments:
|
|
668
|
+
# body :: Response body to compress with gzip
|
|
669
|
+
# mtime :: The modification time of the body, used to set the
|
|
670
|
+
# modification time in the gzip header.
|
|
671
|
+
# sync :: Whether to flush each gzip chunk as soon as it is ready.
|
|
672
|
+
#
|
|
673
|
+
# pkg:gem/rack#lib/rack/deflater.rb:92
|
|
674
|
+
def initialize(body, mtime, sync); end
|
|
675
|
+
|
|
676
|
+
# Close the original body if possible.
|
|
677
|
+
#
|
|
678
|
+
# pkg:gem/rack#lib/rack/deflater.rb:128
|
|
679
|
+
def close; end
|
|
680
|
+
|
|
681
|
+
# Yield gzip compressed strings to the given block.
|
|
682
|
+
#
|
|
683
|
+
# pkg:gem/rack#lib/rack/deflater.rb:99
|
|
684
|
+
def each(&block); end
|
|
685
|
+
|
|
686
|
+
# Call the block passed to #each with the gzipped data.
|
|
687
|
+
#
|
|
688
|
+
# pkg:gem/rack#lib/rack/deflater.rb:123
|
|
689
|
+
def write(data); end
|
|
690
|
+
end
|
|
691
|
+
|
|
692
|
+
# pkg:gem/rack#lib/rack/deflater.rb:85
|
|
693
|
+
Rack::Deflater::GzipStream::BUFFER_LENGTH = T.let(T.unsafe(nil), Integer)
|
|
694
|
+
|
|
695
|
+
# Rack::Directory serves entries below the +root+ given, according to the
|
|
696
|
+
# path info of the Rack request. If a directory is found, the file's contents
|
|
697
|
+
# will be presented in an html based index. If a file is found, the env will
|
|
698
|
+
# be passed to the specified +app+.
|
|
699
|
+
#
|
|
700
|
+
# If +app+ is not specified, a Rack::Files of the same +root+ will be used.
|
|
701
|
+
#
|
|
702
|
+
# pkg:gem/rack#lib/rack/directory.rb:19
|
|
703
|
+
class Rack::Directory
|
|
704
|
+
# Set the root directory and application for serving files.
|
|
705
|
+
#
|
|
706
|
+
# pkg:gem/rack#lib/rack/directory.rb:83
|
|
707
|
+
def initialize(root, app = T.unsafe(nil)); end
|
|
708
|
+
|
|
709
|
+
# pkg:gem/rack#lib/rack/directory.rb:90
|
|
710
|
+
def call(env); end
|
|
711
|
+
|
|
712
|
+
# Rack response to use for requests with invalid paths, or nil if path is valid.
|
|
713
|
+
#
|
|
714
|
+
# pkg:gem/rack#lib/rack/directory.rb:110
|
|
715
|
+
def check_bad_request(path_info); end
|
|
716
|
+
|
|
717
|
+
# Rack response to use for requests with paths outside the root, or nil if path is inside the root.
|
|
718
|
+
#
|
|
719
|
+
# pkg:gem/rack#lib/rack/directory.rb:120
|
|
720
|
+
def check_forbidden(path_info); end
|
|
721
|
+
|
|
722
|
+
# Rack response to use for unreadable and non-file, non-directory entries.
|
|
723
|
+
#
|
|
724
|
+
# pkg:gem/rack#lib/rack/directory.rb:184
|
|
725
|
+
def entity_not_found(path_info); end
|
|
726
|
+
|
|
727
|
+
# Provide human readable file sizes
|
|
728
|
+
#
|
|
729
|
+
# pkg:gem/rack#lib/rack/directory.rb:200
|
|
730
|
+
def filesize_format(int); end
|
|
731
|
+
|
|
732
|
+
# Internals of request handling. Similar to call but does
|
|
733
|
+
# not remove body for HEAD requests.
|
|
734
|
+
#
|
|
735
|
+
# pkg:gem/rack#lib/rack/directory.rb:97
|
|
736
|
+
def get(env); end
|
|
737
|
+
|
|
738
|
+
# Rack response to use for directories under the root.
|
|
739
|
+
#
|
|
740
|
+
# pkg:gem/rack#lib/rack/directory.rb:133
|
|
741
|
+
def list_directory(path_info, path, script_name); end
|
|
742
|
+
|
|
743
|
+
# Rack response to use for files and directories under the root.
|
|
744
|
+
# Unreadable and non-file, non-directory entries will get a 404 response.
|
|
745
|
+
#
|
|
746
|
+
# pkg:gem/rack#lib/rack/directory.rb:174
|
|
747
|
+
def list_path(env, path, path_info, script_name); end
|
|
748
|
+
|
|
749
|
+
# The root of the directory hierarchy. Only requests for files and
|
|
750
|
+
# directories inside of the root directory are supported.
|
|
751
|
+
#
|
|
752
|
+
# pkg:gem/rack#lib/rack/directory.rb:80
|
|
753
|
+
def root; end
|
|
754
|
+
|
|
755
|
+
# File::Stat for the given path, but return nil for missing/bad entries.
|
|
756
|
+
#
|
|
757
|
+
# pkg:gem/rack#lib/rack/directory.rb:166
|
|
758
|
+
def stat(path); end
|
|
759
|
+
end
|
|
760
|
+
|
|
761
|
+
# pkg:gem/rack#lib/rack/directory.rb:20
|
|
762
|
+
Rack::Directory::DIR_FILE = T.let(T.unsafe(nil), String)
|
|
763
|
+
|
|
764
|
+
# pkg:gem/rack#lib/rack/directory.rb:43
|
|
765
|
+
Rack::Directory::DIR_PAGE_FOOTER = T.let(T.unsafe(nil), String)
|
|
766
|
+
|
|
767
|
+
# pkg:gem/rack#lib/rack/directory.rb:21
|
|
768
|
+
Rack::Directory::DIR_PAGE_HEADER = T.let(T.unsafe(nil), String)
|
|
769
|
+
|
|
770
|
+
# Body class for directory entries, showing an index page with links
|
|
771
|
+
# to each file.
|
|
772
|
+
#
|
|
773
|
+
# pkg:gem/rack#lib/rack/directory.rb:51
|
|
774
|
+
class Rack::Directory::DirectoryBody < ::Struct
|
|
775
|
+
# Yield strings for each part of the directory entry
|
|
776
|
+
#
|
|
777
|
+
# pkg:gem/rack#lib/rack/directory.rb:53
|
|
778
|
+
def each; end
|
|
779
|
+
|
|
780
|
+
private
|
|
781
|
+
|
|
782
|
+
# Escape each element in the array of html strings.
|
|
783
|
+
#
|
|
784
|
+
# pkg:gem/rack#lib/rack/directory.rb:73
|
|
785
|
+
def DIR_FILE_escape(htmls); end
|
|
786
|
+
end
|
|
787
|
+
|
|
788
|
+
# Stolen from Ramaze
|
|
789
|
+
#
|
|
790
|
+
# pkg:gem/rack#lib/rack/directory.rb:192
|
|
791
|
+
Rack::Directory::FILESIZE_FORMAT = T.let(T.unsafe(nil), Array)
|
|
792
|
+
|
|
793
|
+
# pkg:gem/rack#lib/rack/constants.rb:22
|
|
794
|
+
Rack::ETAG = T.let(T.unsafe(nil), String)
|
|
795
|
+
|
|
796
|
+
# Automatically sets the etag header on all String bodies.
|
|
797
|
+
#
|
|
798
|
+
# The etag header is skipped if etag or last-modified headers are sent or if
|
|
799
|
+
# a sendfile body (body.responds_to :to_path) is given (since such cases
|
|
800
|
+
# should be handled by apache/nginx).
|
|
801
|
+
#
|
|
802
|
+
# On initialization, you can pass two parameters: a cache-control directive
|
|
803
|
+
# used when etag is absent and a directive when it is present. The first
|
|
804
|
+
# defaults to nil, while the second defaults to "max-age=0, private, must-revalidate"
|
|
805
|
+
#
|
|
806
|
+
# pkg:gem/rack#lib/rack/etag.rb:18
|
|
807
|
+
class Rack::ETag
|
|
808
|
+
# pkg:gem/rack#lib/rack/etag.rb:22
|
|
809
|
+
def initialize(app, no_cache_control = T.unsafe(nil), cache_control = T.unsafe(nil)); end
|
|
810
|
+
|
|
811
|
+
# pkg:gem/rack#lib/rack/etag.rb:28
|
|
812
|
+
def call(env); end
|
|
813
|
+
|
|
814
|
+
private
|
|
815
|
+
|
|
816
|
+
# pkg:gem/rack#lib/rack/etag.rb:61
|
|
817
|
+
def digest_body(body); end
|
|
818
|
+
|
|
819
|
+
# pkg:gem/rack#lib/rack/etag.rb:53
|
|
820
|
+
def etag_status?(status); end
|
|
821
|
+
|
|
822
|
+
# pkg:gem/rack#lib/rack/etag.rb:57
|
|
823
|
+
def skip_caching?(headers); end
|
|
824
|
+
end
|
|
825
|
+
|
|
826
|
+
# pkg:gem/rack#lib/rack/etag.rb:20
|
|
827
|
+
Rack::ETag::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String)
|
|
828
|
+
|
|
829
|
+
# pkg:gem/rack#lib/rack/etag.rb:19
|
|
830
|
+
Rack::ETag::ETAG_STRING = T.let(T.unsafe(nil), String)
|
|
831
|
+
|
|
832
|
+
# pkg:gem/rack#lib/rack/constants.rb:23
|
|
833
|
+
Rack::EXPIRES = T.let(T.unsafe(nil), String)
|
|
834
|
+
|
|
835
|
+
# This middleware provides hooks to certain places in the request /
|
|
836
|
+
# response lifecycle. This is so that middleware that don't need to filter
|
|
837
|
+
# the response data can safely leave it alone and not have to send messages
|
|
838
|
+
# down the traditional "rack stack".
|
|
839
|
+
#
|
|
840
|
+
# The events are:
|
|
841
|
+
#
|
|
842
|
+
# * on_start(request, response)
|
|
843
|
+
#
|
|
844
|
+
# This event is sent at the start of the request, before the next
|
|
845
|
+
# middleware in the chain is called. This method is called with a request
|
|
846
|
+
# object, and a response object. Right now, the response object is always
|
|
847
|
+
# nil, but in the future it may actually be a real response object.
|
|
848
|
+
#
|
|
849
|
+
# * on_commit(request, response)
|
|
850
|
+
#
|
|
851
|
+
# The response has been committed. The application has returned, but the
|
|
852
|
+
# response has not been sent to the webserver yet. This method is always
|
|
853
|
+
# called with a request object and the response object. The response
|
|
854
|
+
# object is constructed from the rack triple that the application returned.
|
|
855
|
+
# Changes may still be made to the response object at this point.
|
|
856
|
+
#
|
|
857
|
+
# * on_send(request, response)
|
|
858
|
+
#
|
|
859
|
+
# The webserver has started iterating over the response body, or has called
|
|
860
|
+
# the streaming body, and presumably has started sending data over the
|
|
861
|
+
# wire. This method is always called with a request object and the response
|
|
862
|
+
# object. The response object is constructed from the rack triple that the
|
|
863
|
+
# application returned. Changes SHOULD NOT be made to the response object
|
|
864
|
+
# as the webserver has already started sending data. Any mutations will
|
|
865
|
+
# likely result in an exception.
|
|
866
|
+
#
|
|
867
|
+
# * on_finish(request, response)
|
|
868
|
+
#
|
|
869
|
+
# The webserver has closed the response, and all data has been written to
|
|
870
|
+
# the response socket. The request and response object should both be
|
|
871
|
+
# read-only at this point. The body MAY NOT be available on the response
|
|
872
|
+
# object as it may have been flushed to the socket.
|
|
873
|
+
#
|
|
874
|
+
# * on_error(request, response, error)
|
|
875
|
+
#
|
|
876
|
+
# An exception has occurred in the application or an `on_commit` event.
|
|
877
|
+
# This method will get the request, the response (if available) and the
|
|
878
|
+
# exception that was raised.
|
|
879
|
+
#
|
|
880
|
+
# ## Order
|
|
881
|
+
#
|
|
882
|
+
# `on_start` is called on the handlers in the order that they were passed to
|
|
883
|
+
# the constructor. `on_commit`, on_send`, `on_finish`, and `on_error` are
|
|
884
|
+
# called in the reverse order. `on_finish` handlers are called inside an
|
|
885
|
+
# `ensure` block, so they are guaranteed to be called even if something
|
|
886
|
+
# raises an exception. If something raises an exception in a `on_finish`
|
|
887
|
+
# method, then nothing is guaranteed.
|
|
888
|
+
#
|
|
889
|
+
# pkg:gem/rack#lib/rack/events.rb:62
|
|
890
|
+
class Rack::Events
|
|
891
|
+
# pkg:gem/rack#lib/rack/events.rb:121
|
|
892
|
+
def initialize(app, handlers); end
|
|
893
|
+
|
|
894
|
+
# pkg:gem/rack#lib/rack/events.rb:126
|
|
895
|
+
def call(env); end
|
|
896
|
+
|
|
897
|
+
private
|
|
898
|
+
|
|
899
|
+
# pkg:gem/rack#lib/rack/events.rb:164
|
|
900
|
+
def make_request(env); end
|
|
901
|
+
|
|
902
|
+
# pkg:gem/rack#lib/rack/events.rb:168
|
|
903
|
+
def make_response(status, headers, body); end
|
|
904
|
+
|
|
905
|
+
# pkg:gem/rack#lib/rack/events.rb:152
|
|
906
|
+
def on_commit(request, response); end
|
|
907
|
+
|
|
908
|
+
# pkg:gem/rack#lib/rack/events.rb:148
|
|
909
|
+
def on_error(request, response, e); end
|
|
910
|
+
|
|
911
|
+
# pkg:gem/rack#lib/rack/events.rb:160
|
|
912
|
+
def on_finish(request, response); end
|
|
913
|
+
|
|
914
|
+
# pkg:gem/rack#lib/rack/events.rb:156
|
|
915
|
+
def on_start(request, response); end
|
|
916
|
+
end
|
|
917
|
+
|
|
918
|
+
# pkg:gem/rack#lib/rack/events.rb:63
|
|
919
|
+
module Rack::Events::Abstract
|
|
920
|
+
# pkg:gem/rack#lib/rack/events.rb:67
|
|
921
|
+
def on_commit(req, res); end
|
|
922
|
+
|
|
923
|
+
# pkg:gem/rack#lib/rack/events.rb:76
|
|
924
|
+
def on_error(req, res, e); end
|
|
925
|
+
|
|
926
|
+
# pkg:gem/rack#lib/rack/events.rb:73
|
|
927
|
+
def on_finish(req, res); end
|
|
928
|
+
|
|
929
|
+
# pkg:gem/rack#lib/rack/events.rb:70
|
|
930
|
+
def on_send(req, res); end
|
|
931
|
+
|
|
932
|
+
# pkg:gem/rack#lib/rack/events.rb:64
|
|
933
|
+
def on_start(req, res); end
|
|
934
|
+
end
|
|
935
|
+
|
|
936
|
+
# pkg:gem/rack#lib/rack/events.rb:110
|
|
937
|
+
class Rack::Events::BufferedResponse < ::Rack::Response::Raw
|
|
938
|
+
# pkg:gem/rack#lib/rack/events.rb:113
|
|
939
|
+
def initialize(status, headers, body); end
|
|
940
|
+
|
|
941
|
+
# pkg:gem/rack#lib/rack/events.rb:111
|
|
942
|
+
def body; end
|
|
943
|
+
|
|
944
|
+
# pkg:gem/rack#lib/rack/events.rb:118
|
|
945
|
+
def to_a; end
|
|
946
|
+
end
|
|
947
|
+
|
|
948
|
+
# pkg:gem/rack#lib/rack/events.rb:80
|
|
949
|
+
class Rack::Events::EventedBodyProxy < ::Rack::BodyProxy
|
|
950
|
+
# pkg:gem/rack#lib/rack/events.rb:83
|
|
951
|
+
def initialize(body, request, response, handlers, &block); end
|
|
952
|
+
|
|
953
|
+
# pkg:gem/rack#lib/rack/events.rb:95
|
|
954
|
+
def call(stream); end
|
|
955
|
+
|
|
956
|
+
# pkg:gem/rack#lib/rack/events.rb:90
|
|
957
|
+
def each; end
|
|
958
|
+
|
|
959
|
+
# pkg:gem/rack#lib/rack/events.rb:81
|
|
960
|
+
def request; end
|
|
961
|
+
|
|
962
|
+
# pkg:gem/rack#lib/rack/events.rb:100
|
|
963
|
+
def respond_to?(method_name, include_all = T.unsafe(nil)); end
|
|
964
|
+
|
|
965
|
+
# pkg:gem/rack#lib/rack/events.rb:81
|
|
966
|
+
def response; end
|
|
967
|
+
end
|
|
968
|
+
|
|
969
|
+
# Rack::Files serves files below the +root+ directory given, according to the
|
|
970
|
+
# path info of the Rack request.
|
|
971
|
+
# e.g. when Rack::Files.new("/etc") is used, you can access 'passwd' file
|
|
972
|
+
# as http://localhost:9292/passwd
|
|
973
|
+
#
|
|
974
|
+
# Handlers can detect if bodies are a Rack::Files, and use mechanisms
|
|
975
|
+
# like sendfile on the +path+.
|
|
976
|
+
#
|
|
977
|
+
# pkg:gem/rack#lib/rack/files.rb:20
|
|
978
|
+
class Rack::Files
|
|
979
|
+
# pkg:gem/rack#lib/rack/files.rb:27
|
|
980
|
+
def initialize(root, headers = T.unsafe(nil), default_mime = T.unsafe(nil)); end
|
|
981
|
+
|
|
982
|
+
# pkg:gem/rack#lib/rack/files.rb:34
|
|
983
|
+
def call(env); end
|
|
984
|
+
|
|
985
|
+
# pkg:gem/rack#lib/rack/files.rb:39
|
|
986
|
+
def get(env); end
|
|
987
|
+
|
|
988
|
+
# pkg:gem/rack#lib/rack/files.rb:25
|
|
989
|
+
def root; end
|
|
990
|
+
|
|
991
|
+
# pkg:gem/rack#lib/rack/files.rb:68
|
|
992
|
+
def serving(request, path); end
|
|
993
|
+
|
|
994
|
+
private
|
|
995
|
+
|
|
996
|
+
# pkg:gem/rack#lib/rack/files.rb:190
|
|
997
|
+
def fail(status, body, headers = T.unsafe(nil)); end
|
|
998
|
+
|
|
999
|
+
# pkg:gem/rack#lib/rack/files.rb:209
|
|
1000
|
+
def filesize(path); end
|
|
1001
|
+
|
|
1002
|
+
# The MIME type for the contents of the file located at @path
|
|
1003
|
+
#
|
|
1004
|
+
# pkg:gem/rack#lib/rack/files.rb:205
|
|
1005
|
+
def mime_type(path, default_mime); end
|
|
1006
|
+
end
|
|
1007
|
+
|
|
1008
|
+
# pkg:gem/rack#lib/rack/files.rb:21
|
|
1009
|
+
Rack::Files::ALLOWED_VERBS = T.let(T.unsafe(nil), Array)
|
|
1010
|
+
|
|
1011
|
+
# pkg:gem/rack#lib/rack/files.rb:22
|
|
1012
|
+
Rack::Files::ALLOW_HEADER = T.let(T.unsafe(nil), String)
|
|
1013
|
+
|
|
1014
|
+
# pkg:gem/rack#lib/rack/files.rb:121
|
|
1015
|
+
class Rack::Files::BaseIterator
|
|
1016
|
+
# pkg:gem/rack#lib/rack/files.rb:124
|
|
1017
|
+
def initialize(path, ranges, options); end
|
|
1018
|
+
|
|
1019
|
+
# pkg:gem/rack#lib/rack/files.rb:144
|
|
1020
|
+
def bytesize; end
|
|
1021
|
+
|
|
1022
|
+
# pkg:gem/rack#lib/rack/files.rb:153
|
|
1023
|
+
def close; end
|
|
1024
|
+
|
|
1025
|
+
# pkg:gem/rack#lib/rack/files.rb:130
|
|
1026
|
+
def each; end
|
|
1027
|
+
|
|
1028
|
+
# pkg:gem/rack#lib/rack/files.rb:122
|
|
1029
|
+
def options; end
|
|
1030
|
+
|
|
1031
|
+
# pkg:gem/rack#lib/rack/files.rb:122
|
|
1032
|
+
def path; end
|
|
1033
|
+
|
|
1034
|
+
# pkg:gem/rack#lib/rack/files.rb:122
|
|
1035
|
+
def ranges; end
|
|
1036
|
+
|
|
1037
|
+
private
|
|
1038
|
+
|
|
1039
|
+
# pkg:gem/rack#lib/rack/files.rb:171
|
|
1040
|
+
def each_range_part(file, range); end
|
|
1041
|
+
|
|
1042
|
+
# pkg:gem/rack#lib/rack/files.rb:157
|
|
1043
|
+
def multipart?; end
|
|
1044
|
+
|
|
1045
|
+
# pkg:gem/rack#lib/rack/files.rb:161
|
|
1046
|
+
def multipart_heading(range); end
|
|
1047
|
+
end
|
|
1048
|
+
|
|
1049
|
+
# pkg:gem/rack#lib/rack/files.rb:184
|
|
1050
|
+
class Rack::Files::Iterator < ::Rack::Files::BaseIterator
|
|
1051
|
+
# pkg:gem/rack#lib/rack/files.rb:185
|
|
1052
|
+
def to_path; end
|
|
1053
|
+
end
|
|
1054
|
+
|
|
1055
|
+
# pkg:gem/rack#lib/rack/files.rb:23
|
|
1056
|
+
Rack::Files::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
|
|
1057
|
+
|
|
1058
|
+
# Rack::ForwardRequest gets caught by Rack::Recursive and redirects
|
|
1059
|
+
# the current request to the app at +url+.
|
|
1060
|
+
#
|
|
1061
|
+
# raise ForwardRequest.new("/not-found")
|
|
1062
|
+
#
|
|
1063
|
+
# pkg:gem/rack#lib/rack/recursive.rb:14
|
|
1064
|
+
class Rack::ForwardRequest < ::Exception
|
|
1065
|
+
# pkg:gem/rack#lib/rack/recursive.rb:17
|
|
1066
|
+
def initialize(url, env = T.unsafe(nil)); end
|
|
1067
|
+
|
|
1068
|
+
# pkg:gem/rack#lib/rack/recursive.rb:15
|
|
1069
|
+
def env; end
|
|
1070
|
+
|
|
1071
|
+
# pkg:gem/rack#lib/rack/recursive.rb:15
|
|
1072
|
+
def url; end
|
|
1073
|
+
end
|
|
1074
|
+
|
|
1075
|
+
# HTTP method verbs
|
|
1076
|
+
#
|
|
1077
|
+
# pkg:gem/rack#lib/rack/constants.rb:28
|
|
1078
|
+
Rack::GET = T.let(T.unsafe(nil), String)
|
|
1079
|
+
|
|
1080
|
+
# pkg:gem/rack#lib/rack/constants.rb:33
|
|
1081
|
+
Rack::HEAD = T.let(T.unsafe(nil), String)
|
|
1082
|
+
|
|
1083
|
+
# pkg:gem/rack#lib/rack/constants.rb:7
|
|
1084
|
+
Rack::HTTPS = T.let(T.unsafe(nil), String)
|
|
1085
|
+
|
|
1086
|
+
# pkg:gem/rack#lib/rack/constants.rb:16
|
|
1087
|
+
Rack::HTTP_COOKIE = T.let(T.unsafe(nil), String)
|
|
1088
|
+
|
|
1089
|
+
# Request env keys
|
|
1090
|
+
#
|
|
1091
|
+
# pkg:gem/rack#lib/rack/constants.rb:5
|
|
1092
|
+
Rack::HTTP_HOST = T.let(T.unsafe(nil), String)
|
|
1093
|
+
|
|
1094
|
+
# pkg:gem/rack#lib/rack/constants.rb:6
|
|
1095
|
+
Rack::HTTP_PORT = T.let(T.unsafe(nil), String)
|
|
1096
|
+
|
|
1097
|
+
# Rack::Head returns an empty body for all HEAD requests. It leaves
|
|
1098
|
+
# all other requests unchanged.
|
|
1099
|
+
#
|
|
1100
|
+
# pkg:gem/rack#lib/rack/head.rb:9
|
|
1101
|
+
class Rack::Head
|
|
1102
|
+
# pkg:gem/rack#lib/rack/head.rb:10
|
|
1103
|
+
def initialize(app); end
|
|
1104
|
+
|
|
1105
|
+
# pkg:gem/rack#lib/rack/head.rb:14
|
|
1106
|
+
def call(env); end
|
|
1107
|
+
end
|
|
1108
|
+
|
|
1109
|
+
# Rack::Headers is a Hash subclass that downcases all keys. It's designed
|
|
1110
|
+
# to be used by rack applications that don't implement the Rack 3 SPEC
|
|
1111
|
+
# (by using non-lowercase response header keys), automatically handling
|
|
1112
|
+
# the downcasing of keys.
|
|
1113
|
+
#
|
|
1114
|
+
# pkg:gem/rack#lib/rack/headers.rb:8
|
|
1115
|
+
class Rack::Headers < ::Hash
|
|
1116
|
+
# pkg:gem/rack#lib/rack/headers.rb:110
|
|
1117
|
+
def [](key); end
|
|
1118
|
+
|
|
1119
|
+
# pkg:gem/rack#lib/rack/headers.rb:114
|
|
1120
|
+
def []=(key, value); end
|
|
1121
|
+
|
|
1122
|
+
# pkg:gem/rack#lib/rack/headers.rb:119
|
|
1123
|
+
def assoc(key); end
|
|
1124
|
+
|
|
1125
|
+
# pkg:gem/rack#lib/rack/headers.rb:123
|
|
1126
|
+
def compare_by_identity; end
|
|
1127
|
+
|
|
1128
|
+
# pkg:gem/rack#lib/rack/headers.rb:127
|
|
1129
|
+
def delete(key); end
|
|
1130
|
+
|
|
1131
|
+
# pkg:gem/rack#lib/rack/headers.rb:131
|
|
1132
|
+
def dig(key, *a); end
|
|
1133
|
+
|
|
1134
|
+
# :nocov:
|
|
1135
|
+
#
|
|
1136
|
+
# pkg:gem/rack#lib/rack/headers.rb:227
|
|
1137
|
+
def except(*a); end
|
|
1138
|
+
|
|
1139
|
+
# pkg:gem/rack#lib/rack/headers.rb:135
|
|
1140
|
+
def fetch(key, *default, &block); end
|
|
1141
|
+
|
|
1142
|
+
# pkg:gem/rack#lib/rack/headers.rb:140
|
|
1143
|
+
def fetch_values(*a); end
|
|
1144
|
+
|
|
1145
|
+
# pkg:gem/rack#lib/rack/headers.rb:144
|
|
1146
|
+
def has_key?(key); end
|
|
1147
|
+
|
|
1148
|
+
# pkg:gem/rack#lib/rack/headers.rb:147
|
|
1149
|
+
def include?(key); end
|
|
1150
|
+
|
|
1151
|
+
# pkg:gem/rack#lib/rack/headers.rb:151
|
|
1152
|
+
def invert; end
|
|
1153
|
+
|
|
1154
|
+
# pkg:gem/rack#lib/rack/headers.rb:148
|
|
1155
|
+
def key?(key); end
|
|
1156
|
+
|
|
1157
|
+
# pkg:gem/rack#lib/rack/headers.rb:149
|
|
1158
|
+
def member?(key); end
|
|
1159
|
+
|
|
1160
|
+
# pkg:gem/rack#lib/rack/headers.rb:157
|
|
1161
|
+
def merge(hash, &block); end
|
|
1162
|
+
|
|
1163
|
+
# pkg:gem/rack#lib/rack/headers.rb:196
|
|
1164
|
+
def merge!(hash, &block); end
|
|
1165
|
+
|
|
1166
|
+
# pkg:gem/rack#lib/rack/headers.rb:161
|
|
1167
|
+
def reject(&block); end
|
|
1168
|
+
|
|
1169
|
+
# pkg:gem/rack#lib/rack/headers.rb:167
|
|
1170
|
+
def replace(hash); end
|
|
1171
|
+
|
|
1172
|
+
# pkg:gem/rack#lib/rack/headers.rb:172
|
|
1173
|
+
def select(&block); end
|
|
1174
|
+
|
|
1175
|
+
# :nocov:
|
|
1176
|
+
#
|
|
1177
|
+
# pkg:gem/rack#lib/rack/headers.rb:205
|
|
1178
|
+
def slice(*a); end
|
|
1179
|
+
|
|
1180
|
+
# pkg:gem/rack#lib/rack/headers.rb:117
|
|
1181
|
+
def store(key, value); end
|
|
1182
|
+
|
|
1183
|
+
# pkg:gem/rack#lib/rack/headers.rb:178
|
|
1184
|
+
def to_proc; end
|
|
1185
|
+
|
|
1186
|
+
# pkg:gem/rack#lib/rack/headers.rb:211
|
|
1187
|
+
def transform_keys(&block); end
|
|
1188
|
+
|
|
1189
|
+
# pkg:gem/rack#lib/rack/headers.rb:215
|
|
1190
|
+
def transform_keys!; end
|
|
1191
|
+
|
|
1192
|
+
# pkg:gem/rack#lib/rack/headers.rb:182
|
|
1193
|
+
def transform_values(&block); end
|
|
1194
|
+
|
|
1195
|
+
# pkg:gem/rack#lib/rack/headers.rb:186
|
|
1196
|
+
def update(hash, &block); end
|
|
1197
|
+
|
|
1198
|
+
# pkg:gem/rack#lib/rack/headers.rb:198
|
|
1199
|
+
def values_at(*keys); end
|
|
1200
|
+
|
|
1201
|
+
private
|
|
1202
|
+
|
|
1203
|
+
# pkg:gem/rack#lib/rack/headers.rb:234
|
|
1204
|
+
def downcase_key(key); end
|
|
1205
|
+
|
|
1206
|
+
class << self
|
|
1207
|
+
# pkg:gem/rack#lib/rack/headers.rb:91
|
|
1208
|
+
def [](*items); end
|
|
1209
|
+
end
|
|
1210
|
+
end
|
|
1211
|
+
|
|
1212
|
+
# pkg:gem/rack#lib/rack/headers.rb:9
|
|
1213
|
+
Rack::Headers::KNOWN_HEADERS = T.let(T.unsafe(nil), Hash)
|
|
1214
|
+
|
|
1215
|
+
# pkg:gem/rack#lib/rack/constants.rb:36
|
|
1216
|
+
Rack::LINK = T.let(T.unsafe(nil), String)
|
|
1217
|
+
|
|
1218
|
+
# Validates your application and the requests and responses according to the Rack spec. See SPEC.rdoc for details.
|
|
1219
|
+
#
|
|
1220
|
+
# pkg:gem/rack#lib/rack/lint.rb:10
|
|
1221
|
+
class Rack::Lint
|
|
1222
|
+
# 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.
|
|
1223
|
+
#
|
|
1224
|
+
# = Rack Specification
|
|
1225
|
+
#
|
|
1226
|
+
# 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.
|
|
1227
|
+
#
|
|
1228
|
+
# == The Application
|
|
1229
|
+
#
|
|
1230
|
+
# A Rack application is a Ruby object that responds to +call+. \
|
|
1231
|
+
#
|
|
1232
|
+
# pkg:gem/rack#lib/rack/lint.rb:65
|
|
1233
|
+
def initialize(app); end
|
|
1234
|
+
|
|
1235
|
+
# Invoke the application, validating the request and response according to the Rack spec.
|
|
1236
|
+
#
|
|
1237
|
+
# pkg:gem/rack#lib/rack/lint.rb:15
|
|
1238
|
+
def call(env = T.unsafe(nil)); end
|
|
1239
|
+
end
|
|
1240
|
+
|
|
1241
|
+
# :stopdoc:
|
|
1242
|
+
#
|
|
1243
|
+
# pkg:gem/rack#lib/rack/lint.rb:21
|
|
1244
|
+
Rack::Lint::ALLOWED_SCHEMES = T.let(T.unsafe(nil), Array)
|
|
1245
|
+
|
|
1246
|
+
# Match a host name, according to RFC3986. Copied from `URI::RFC3986_Parser::HOST` because older Ruby versions (< 3.3) don't expose it.
|
|
1247
|
+
#
|
|
1248
|
+
# pkg:gem/rack#lib/rack/lint.rb:29
|
|
1249
|
+
Rack::Lint::HOST_PATTERN = T.let(T.unsafe(nil), Regexp)
|
|
1250
|
+
|
|
1251
|
+
# pkg:gem/rack#lib/rack/lint.rb:52
|
|
1252
|
+
Rack::Lint::HTTP_HOST_PATTERN = T.let(T.unsafe(nil), Regexp)
|
|
1253
|
+
|
|
1254
|
+
# Represents a failure to meet the Rack specification.
|
|
1255
|
+
#
|
|
1256
|
+
# pkg:gem/rack#lib/rack/lint.rb:12
|
|
1257
|
+
class Rack::Lint::LintError < ::RuntimeError; end
|
|
1258
|
+
|
|
1259
|
+
# pkg:gem/rack#lib/rack/lint.rb:24
|
|
1260
|
+
Rack::Lint::REQUEST_PATH_ABSOLUTE_FORM = T.let(T.unsafe(nil), Regexp)
|
|
1261
|
+
|
|
1262
|
+
# pkg:gem/rack#lib/rack/lint.rb:26
|
|
1263
|
+
Rack::Lint::REQUEST_PATH_ASTERISK_FORM = T.let(T.unsafe(nil), String)
|
|
1264
|
+
|
|
1265
|
+
# pkg:gem/rack#lib/rack/lint.rb:25
|
|
1266
|
+
Rack::Lint::REQUEST_PATH_AUTHORITY_FORM = T.let(T.unsafe(nil), Regexp)
|
|
1267
|
+
|
|
1268
|
+
# pkg:gem/rack#lib/rack/lint.rb:23
|
|
1269
|
+
Rack::Lint::REQUEST_PATH_ORIGIN_FORM = T.let(T.unsafe(nil), Regexp)
|
|
1270
|
+
|
|
1271
|
+
# pkg:gem/rack#lib/rack/lint.rb:51
|
|
1272
|
+
Rack::Lint::SERVER_NAME_PATTERN = T.let(T.unsafe(nil), Regexp)
|
|
1273
|
+
|
|
1274
|
+
# pkg:gem/rack#lib/rack/lint.rb:71
|
|
1275
|
+
class Rack::Lint::Wrapper
|
|
1276
|
+
# pkg:gem/rack#lib/rack/lint.rb:72
|
|
1277
|
+
def initialize(app, env); end
|
|
1278
|
+
|
|
1279
|
+
# ==== Streaming Body
|
|
1280
|
+
#
|
|
1281
|
+
# pkg:gem/rack#lib/rack/lint.rb:918
|
|
1282
|
+
def call(stream); end
|
|
1283
|
+
|
|
1284
|
+
# ==== The <tt>content-length</tt> Header
|
|
1285
|
+
#
|
|
1286
|
+
# pkg:gem/rack#lib/rack/lint.rb:768
|
|
1287
|
+
def check_content_length_header(status, headers); end
|
|
1288
|
+
|
|
1289
|
+
# ==== The <tt>content-type</tt> Header
|
|
1290
|
+
#
|
|
1291
|
+
# pkg:gem/rack#lib/rack/lint.rb:753
|
|
1292
|
+
def check_content_type_header(status, headers); end
|
|
1293
|
+
|
|
1294
|
+
# === Early Hints
|
|
1295
|
+
#
|
|
1296
|
+
# The application or any middleware may call the <tt>rack.early_hints</tt> with an object which would be valid as the headers of a Rack response.
|
|
1297
|
+
#
|
|
1298
|
+
# pkg:gem/rack#lib/rack/lint.rb:670
|
|
1299
|
+
def check_early_hints(env); end
|
|
1300
|
+
|
|
1301
|
+
# == The Request Environment
|
|
1302
|
+
#
|
|
1303
|
+
# Incoming HTTP requests are represented using an environment. \
|
|
1304
|
+
#
|
|
1305
|
+
# pkg:gem/rack#lib/rack/lint.rb:136
|
|
1306
|
+
def check_environment(env); end
|
|
1307
|
+
|
|
1308
|
+
# === The Error Stream
|
|
1309
|
+
#
|
|
1310
|
+
# pkg:gem/rack#lib/rack/lint.rb:571
|
|
1311
|
+
def check_error_stream(error); end
|
|
1312
|
+
|
|
1313
|
+
# pkg:gem/rack#lib/rack/lint.rb:743
|
|
1314
|
+
def check_header_value(key, value); end
|
|
1315
|
+
|
|
1316
|
+
# === The Headers
|
|
1317
|
+
#
|
|
1318
|
+
# pkg:gem/rack#lib/rack/lint.rb:704
|
|
1319
|
+
def check_headers(headers); end
|
|
1320
|
+
|
|
1321
|
+
# === Hijacking
|
|
1322
|
+
#
|
|
1323
|
+
# The hijacking interfaces provides a means for an application to take control of the HTTP connection. There are two distinct hijack interfaces: full hijacking where the application takes over the raw connection, and partial hijacking where the application takes over just the response body stream. In both cases, the application is responsible for closing the hijacked stream.
|
|
1324
|
+
#
|
|
1325
|
+
# Full hijacking only works with HTTP/1. Partial hijacking is functionally equivalent to streaming bodies, and is still optionally supported for backwards compatibility with older Rack versions.
|
|
1326
|
+
#
|
|
1327
|
+
# ==== Full Hijack
|
|
1328
|
+
#
|
|
1329
|
+
# Full hijack is used to completely take over an HTTP/1 connection. It occurs before any headers are written and causes the server to ignore any response generated by the application. It is intended to be used when applications need access to the raw HTTP/1 connection.
|
|
1330
|
+
#
|
|
1331
|
+
# pkg:gem/rack#lib/rack/lint.rb:618
|
|
1332
|
+
def check_hijack(env); end
|
|
1333
|
+
|
|
1334
|
+
# ==== Partial Hijack
|
|
1335
|
+
#
|
|
1336
|
+
# Partial hijack is used for bi-directional streaming of the request and response body. It occurs after the status and headers are written by the server and causes the server to ignore the Body of the response. It is intended to be used when applications need bi-directional streaming.
|
|
1337
|
+
#
|
|
1338
|
+
# pkg:gem/rack#lib/rack/lint.rb:639
|
|
1339
|
+
def check_hijack_response(headers, env); end
|
|
1340
|
+
|
|
1341
|
+
# === The Input Stream
|
|
1342
|
+
#
|
|
1343
|
+
# The input stream is an +IO+-like object which contains the raw HTTP request data. \
|
|
1344
|
+
#
|
|
1345
|
+
# pkg:gem/rack#lib/rack/lint.rb:478
|
|
1346
|
+
def check_input_stream(input); end
|
|
1347
|
+
|
|
1348
|
+
# ==== The <tt>rack.protocol</tt> Header
|
|
1349
|
+
#
|
|
1350
|
+
# pkg:gem/rack#lib/rack/lint.rb:795
|
|
1351
|
+
def check_rack_protocol_header(status, headers); end
|
|
1352
|
+
|
|
1353
|
+
# == The Response
|
|
1354
|
+
#
|
|
1355
|
+
# Outgoing HTTP responses are generated from the response tuple generated by the application. The response tuple is an +Array+ of three elements, which are: the HTTP status, the headers, and the response body. The Rack application is responsible for ensuring that the response tuple is well-formed and should follow the rules set out in this specification.
|
|
1356
|
+
#
|
|
1357
|
+
# === The Status
|
|
1358
|
+
#
|
|
1359
|
+
# pkg:gem/rack#lib/rack/lint.rb:694
|
|
1360
|
+
def check_status(status); end
|
|
1361
|
+
|
|
1362
|
+
# Setting this value informs the server that it should perform a connection upgrade. In HTTP/1, this is done using the +upgrade+ header. In HTTP/2+, this is done by accepting the request.
|
|
1363
|
+
#
|
|
1364
|
+
# === The Body
|
|
1365
|
+
#
|
|
1366
|
+
# The Body is typically an +Array+ of +String+ values, an enumerable that yields +String+ values, a +Proc+, or an +IO+-like object.
|
|
1367
|
+
#
|
|
1368
|
+
# 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.
|
|
1369
|
+
#
|
|
1370
|
+
# A Body that responds to both +each+ and +call+ must be treated as an Enumerable Body, not a Streaming Body. If it responds to +each+, you must call +each+ and not +call+. If the Body doesn't respond to +each+, then you can assume it responds to +call+.
|
|
1371
|
+
#
|
|
1372
|
+
# The Body must either be consumed or returned. The Body is consumed by optionally calling either +each+ or +call+. Then, if the Body responds to +close+, it must be called to release any resources associated with the generation of the body. In other words, +close+ must always be called at least once; typically after the web server has sent the response to the client, but also in cases where the Rack application makes internal/virtual requests and discards the response.
|
|
1373
|
+
#
|
|
1374
|
+
# pkg:gem/rack#lib/rack/lint.rb:821
|
|
1375
|
+
def close; end
|
|
1376
|
+
|
|
1377
|
+
# ==== Enumerable Body
|
|
1378
|
+
#
|
|
1379
|
+
# pkg:gem/rack#lib/rack/lint.rb:852
|
|
1380
|
+
def each; end
|
|
1381
|
+
|
|
1382
|
+
# pkg:gem/rack#lib/rack/lint.rb:895
|
|
1383
|
+
def respond_to?(name, *_arg1); end
|
|
1384
|
+
|
|
1385
|
+
# pkg:gem/rack#lib/rack/lint.rb:87
|
|
1386
|
+
def response; end
|
|
1387
|
+
|
|
1388
|
+
# If the Body responds to +to_ary+, it must return an +Array+ whose contents are identical to that produced by calling +each+. Middleware may call +to_ary+ directly on the Body and return a new Body in its place. In other words, middleware can only process the Body directly if it responds to +to_ary+. If the Body responds to both +to_ary+ and +close+, its implementation of +to_ary+ must call +close+.
|
|
1389
|
+
#
|
|
1390
|
+
# pkg:gem/rack#lib/rack/lint.rb:905
|
|
1391
|
+
def to_ary; end
|
|
1392
|
+
|
|
1393
|
+
# pkg:gem/rack#lib/rack/lint.rb:891
|
|
1394
|
+
def to_path; end
|
|
1395
|
+
|
|
1396
|
+
# pkg:gem/rack#lib/rack/lint.rb:780
|
|
1397
|
+
def verify_content_length(size); end
|
|
1398
|
+
|
|
1399
|
+
# pkg:gem/rack#lib/rack/lint.rb:835
|
|
1400
|
+
def verify_to_path; end
|
|
1401
|
+
|
|
1402
|
+
private
|
|
1403
|
+
|
|
1404
|
+
# pkg:gem/rack#lib/rack/lint.rb:126
|
|
1405
|
+
def assert_required(key); end
|
|
1406
|
+
end
|
|
1407
|
+
|
|
1408
|
+
# pkg:gem/rack#lib/rack/lint.rb:889
|
|
1409
|
+
Rack::Lint::Wrapper::BODY_METHODS = T.let(T.unsafe(nil), Hash)
|
|
1410
|
+
|
|
1411
|
+
# pkg:gem/rack#lib/rack/lint.rb:580
|
|
1412
|
+
class Rack::Lint::Wrapper::ErrorWrapper
|
|
1413
|
+
# pkg:gem/rack#lib/rack/lint.rb:581
|
|
1414
|
+
def initialize(error); end
|
|
1415
|
+
|
|
1416
|
+
# * +close+ must never be called on the error stream.
|
|
1417
|
+
#
|
|
1418
|
+
# pkg:gem/rack#lib/rack/lint.rb:602
|
|
1419
|
+
def close(*args); end
|
|
1420
|
+
|
|
1421
|
+
# * +flush+ must be called without arguments and must be called in order to make the error appear for sure.
|
|
1422
|
+
#
|
|
1423
|
+
# pkg:gem/rack#lib/rack/lint.rb:597
|
|
1424
|
+
def flush; end
|
|
1425
|
+
|
|
1426
|
+
# * +puts+ must be called with a single argument that responds to +to_s+.
|
|
1427
|
+
#
|
|
1428
|
+
# pkg:gem/rack#lib/rack/lint.rb:586
|
|
1429
|
+
def puts(str); end
|
|
1430
|
+
|
|
1431
|
+
# * +write+ must be called with a single argument that is a +String+.
|
|
1432
|
+
#
|
|
1433
|
+
# pkg:gem/rack#lib/rack/lint.rb:591
|
|
1434
|
+
def write(str); end
|
|
1435
|
+
end
|
|
1436
|
+
|
|
1437
|
+
# pkg:gem/rack#lib/rack/lint.rb:495
|
|
1438
|
+
class Rack::Lint::Wrapper::InputWrapper
|
|
1439
|
+
# pkg:gem/rack#lib/rack/lint.rb:496
|
|
1440
|
+
def initialize(input); end
|
|
1441
|
+
|
|
1442
|
+
# * +close+ can be called on the input stream to indicate that any remaining input is not needed.
|
|
1443
|
+
#
|
|
1444
|
+
# pkg:gem/rack#lib/rack/lint.rb:563
|
|
1445
|
+
def close(*args); end
|
|
1446
|
+
|
|
1447
|
+
# * +each+ must be called without arguments and only yield +String+ values.
|
|
1448
|
+
#
|
|
1449
|
+
# pkg:gem/rack#lib/rack/lint.rb:552
|
|
1450
|
+
def each(*args); end
|
|
1451
|
+
|
|
1452
|
+
# * +gets+ must be called without arguments and return a +String+, or +nil+ on EOF (end-of-file).
|
|
1453
|
+
#
|
|
1454
|
+
# pkg:gem/rack#lib/rack/lint.rb:501
|
|
1455
|
+
def gets(*args); end
|
|
1456
|
+
|
|
1457
|
+
# * +read+ behaves like <tt>IO#read</tt>. Its signature is <tt>read([length, [buffer]])</tt>.
|
|
1458
|
+
# * If given, +length+ must be a non-negative Integer (>= 0) or +nil+, and +buffer+ must be a +String+ and may not be +nil+.
|
|
1459
|
+
# * If +length+ is given and not +nil+, then this method reads at most +length+ bytes from the input stream.
|
|
1460
|
+
# * If +length+ is not given or +nil+, then this method reads all data until EOF.
|
|
1461
|
+
# * When EOF is reached, this method returns +nil+ if +length+ is given and not +nil+, or +""+ if +length+ is not given or is +nil+.
|
|
1462
|
+
# * If +buffer+ is given, then the read data will be placed into +buffer+ instead of a newly created +String+.
|
|
1463
|
+
#
|
|
1464
|
+
# pkg:gem/rack#lib/rack/lint.rb:519
|
|
1465
|
+
def read(*args); end
|
|
1466
|
+
end
|
|
1467
|
+
|
|
1468
|
+
# pkg:gem/rack#lib/rack/lint.rb:936
|
|
1469
|
+
class Rack::Lint::Wrapper::StreamWrapper
|
|
1470
|
+
extend ::Forwardable
|
|
1471
|
+
|
|
1472
|
+
# pkg:gem/rack#lib/rack/lint.rb:947
|
|
1473
|
+
def initialize(stream); end
|
|
1474
|
+
|
|
1475
|
+
# pkg:gem/rack#lib/rack/lint.rb:945
|
|
1476
|
+
def <<(*args, **_arg1, &block); end
|
|
1477
|
+
|
|
1478
|
+
# pkg:gem/rack#lib/rack/lint.rb:945
|
|
1479
|
+
def close(*args, **_arg1, &block); end
|
|
1480
|
+
|
|
1481
|
+
# pkg:gem/rack#lib/rack/lint.rb:945
|
|
1482
|
+
def close_read(*args, **_arg1, &block); end
|
|
1483
|
+
|
|
1484
|
+
# pkg:gem/rack#lib/rack/lint.rb:945
|
|
1485
|
+
def close_write(*args, **_arg1, &block); end
|
|
1486
|
+
|
|
1487
|
+
# pkg:gem/rack#lib/rack/lint.rb:945
|
|
1488
|
+
def closed?(*args, **_arg1, &block); end
|
|
1489
|
+
|
|
1490
|
+
# pkg:gem/rack#lib/rack/lint.rb:945
|
|
1491
|
+
def flush(*args, **_arg1, &block); end
|
|
1492
|
+
|
|
1493
|
+
# pkg:gem/rack#lib/rack/lint.rb:945
|
|
1494
|
+
def read(*args, **_arg1, &block); end
|
|
1495
|
+
|
|
1496
|
+
# pkg:gem/rack#lib/rack/lint.rb:945
|
|
1497
|
+
def write(*args, **_arg1, &block); end
|
|
1498
|
+
end
|
|
1499
|
+
|
|
1500
|
+
# The semantics of these +IO+ methods must be a best effort match to those of a normal Ruby +IO+ or +Socket+ object, using standard arguments and raising standard exceptions. Servers may simply pass on real +IO+ objects to the Streaming Body. In some cases (e.g. when using <tt>transfer-encoding</tt> or HTTP/2+), the server may need to provide a wrapper that implements the required methods, in order to provide the correct semantics.
|
|
1501
|
+
#
|
|
1502
|
+
# pkg:gem/rack#lib/rack/lint.rb:940
|
|
1503
|
+
Rack::Lint::Wrapper::StreamWrapper::REQUIRED_METHODS = T.let(T.unsafe(nil), Array)
|
|
1504
|
+
|
|
1505
|
+
# Rack::Lock locks every request inside a mutex, so that every request
|
|
1506
|
+
# will effectively be executed synchronously.
|
|
1507
|
+
#
|
|
1508
|
+
# pkg:gem/rack#lib/rack/lock.rb:8
|
|
1509
|
+
class Rack::Lock
|
|
1510
|
+
# pkg:gem/rack#lib/rack/lock.rb:9
|
|
1511
|
+
def initialize(app, mutex = T.unsafe(nil)); end
|
|
1512
|
+
|
|
1513
|
+
# pkg:gem/rack#lib/rack/lock.rb:13
|
|
1514
|
+
def call(env); end
|
|
1515
|
+
|
|
1516
|
+
private
|
|
1517
|
+
|
|
1518
|
+
# pkg:gem/rack#lib/rack/lock.rb:25
|
|
1519
|
+
def unlock; end
|
|
1520
|
+
end
|
|
1521
|
+
|
|
1522
|
+
# Rack::MediaType parse media type and parameters out of content_type string
|
|
1523
|
+
#
|
|
1524
|
+
# pkg:gem/rack#lib/rack/media_type.rb:6
|
|
1525
|
+
class Rack::MediaType
|
|
1526
|
+
class << self
|
|
1527
|
+
# The media type parameters provided in CONTENT_TYPE as a Hash, or
|
|
1528
|
+
# an empty Hash if no CONTENT_TYPE or media-type parameters were
|
|
1529
|
+
# provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8",
|
|
1530
|
+
# this method responds with the following Hash:
|
|
1531
|
+
# { 'charset' => 'utf-8' }
|
|
1532
|
+
#
|
|
1533
|
+
# This will pass back parameters with empty strings in the hash if they
|
|
1534
|
+
# lack a value (e.g., "text/plain;charset=" will return { 'charset' => '' },
|
|
1535
|
+
# and "text/plain;charset" will return { 'charset' => '' }, similarly to
|
|
1536
|
+
# the query params parser (barring the latter case, which returns nil instead)).
|
|
1537
|
+
#
|
|
1538
|
+
# pkg:gem/rack#lib/rack/media_type.rb:34
|
|
1539
|
+
def params(content_type); end
|
|
1540
|
+
|
|
1541
|
+
# The media type (type/subtype) portion of the CONTENT_TYPE header
|
|
1542
|
+
# without any media type parameters. e.g., when CONTENT_TYPE is
|
|
1543
|
+
# "text/plain;charset=utf-8", the media-type is "text/plain".
|
|
1544
|
+
#
|
|
1545
|
+
# For more information on the use of media types in HTTP, see:
|
|
1546
|
+
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
|
|
1547
|
+
#
|
|
1548
|
+
# pkg:gem/rack#lib/rack/media_type.rb:16
|
|
1549
|
+
def type(content_type); end
|
|
1550
|
+
|
|
1551
|
+
private
|
|
1552
|
+
|
|
1553
|
+
# pkg:gem/rack#lib/rack/media_type.rb:47
|
|
1554
|
+
def strip_doublequotes(str); end
|
|
1555
|
+
end
|
|
1556
|
+
end
|
|
1557
|
+
|
|
1558
|
+
# pkg:gem/rack#lib/rack/media_type.rb:7
|
|
1559
|
+
Rack::MediaType::SPLIT_PATTERN = T.let(T.unsafe(nil), Regexp)
|
|
1560
|
+
|
|
1561
|
+
# pkg:gem/rack#lib/rack/method_override.rb:8
|
|
1562
|
+
class Rack::MethodOverride
|
|
1563
|
+
# pkg:gem/rack#lib/rack/method_override.rb:15
|
|
1564
|
+
def initialize(app); end
|
|
1565
|
+
|
|
1566
|
+
# pkg:gem/rack#lib/rack/method_override.rb:19
|
|
1567
|
+
def call(env); end
|
|
1568
|
+
|
|
1569
|
+
# pkg:gem/rack#lib/rack/method_override.rb:31
|
|
1570
|
+
def method_override(env); end
|
|
1571
|
+
|
|
1572
|
+
private
|
|
1573
|
+
|
|
1574
|
+
# pkg:gem/rack#lib/rack/method_override.rb:44
|
|
1575
|
+
def allowed_methods; end
|
|
1576
|
+
|
|
1577
|
+
# pkg:gem/rack#lib/rack/method_override.rb:48
|
|
1578
|
+
def method_override_param(req); end
|
|
1579
|
+
end
|
|
1580
|
+
|
|
1581
|
+
# pkg:gem/rack#lib/rack/method_override.rb:13
|
|
1582
|
+
Rack::MethodOverride::ALLOWED_METHODS = T.let(T.unsafe(nil), Array)
|
|
1583
|
+
|
|
1584
|
+
# pkg:gem/rack#lib/rack/method_override.rb:9
|
|
1585
|
+
Rack::MethodOverride::HTTP_METHODS = T.let(T.unsafe(nil), Array)
|
|
1586
|
+
|
|
1587
|
+
# pkg:gem/rack#lib/rack/method_override.rb:12
|
|
1588
|
+
Rack::MethodOverride::HTTP_METHOD_OVERRIDE_HEADER = T.let(T.unsafe(nil), String)
|
|
1589
|
+
|
|
1590
|
+
# pkg:gem/rack#lib/rack/method_override.rb:11
|
|
1591
|
+
Rack::MethodOverride::METHOD_OVERRIDE_PARAM_KEY = T.let(T.unsafe(nil), String)
|
|
1592
|
+
|
|
1593
|
+
# pkg:gem/rack#lib/rack/mime.rb:4
|
|
1594
|
+
module Rack::Mime
|
|
1595
|
+
private
|
|
1596
|
+
|
|
1597
|
+
# Returns true if the given value is a mime match for the given mime match
|
|
1598
|
+
# specification, false otherwise.
|
|
1599
|
+
#
|
|
1600
|
+
# Rack::Mime.match?('text/html', 'text/*') => true
|
|
1601
|
+
# Rack::Mime.match?('text/plain', '*') => true
|
|
1602
|
+
# Rack::Mime.match?('text/html', 'application/json') => false
|
|
1603
|
+
#
|
|
1604
|
+
# pkg:gem/rack#lib/rack/mime.rb:30
|
|
1605
|
+
def match?(value, matcher); end
|
|
1606
|
+
|
|
1607
|
+
# Returns String with mime type if found, otherwise use +fallback+.
|
|
1608
|
+
# +ext+ should be filename extension in the '.ext' format that
|
|
1609
|
+
# File.extname(file) returns.
|
|
1610
|
+
# +fallback+ may be any object
|
|
1611
|
+
#
|
|
1612
|
+
# Also see the documentation for MIME_TYPES
|
|
1613
|
+
#
|
|
1614
|
+
# Usage:
|
|
1615
|
+
# Rack::Mime.mime_type('.foo')
|
|
1616
|
+
#
|
|
1617
|
+
# This is a shortcut for:
|
|
1618
|
+
# Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')
|
|
1619
|
+
#
|
|
1620
|
+
# pkg:gem/rack#lib/rack/mime.rb:18
|
|
1621
|
+
def mime_type(ext, fallback = T.unsafe(nil)); end
|
|
1622
|
+
|
|
1623
|
+
class << self
|
|
1624
|
+
# Returns true if the given value is a mime match for the given mime match
|
|
1625
|
+
# specification, false otherwise.
|
|
1626
|
+
#
|
|
1627
|
+
# Rack::Mime.match?('text/html', 'text/*') => true
|
|
1628
|
+
# Rack::Mime.match?('text/plain', '*') => true
|
|
1629
|
+
# Rack::Mime.match?('text/html', 'application/json') => false
|
|
1630
|
+
#
|
|
1631
|
+
# pkg:gem/rack#lib/rack/mime.rb:36
|
|
1632
|
+
def match?(value, matcher); end
|
|
1633
|
+
|
|
1634
|
+
# Returns String with mime type if found, otherwise use +fallback+.
|
|
1635
|
+
# +ext+ should be filename extension in the '.ext' format that
|
|
1636
|
+
# File.extname(file) returns.
|
|
1637
|
+
# +fallback+ may be any object
|
|
1638
|
+
#
|
|
1639
|
+
# Also see the documentation for MIME_TYPES
|
|
1640
|
+
#
|
|
1641
|
+
# Usage:
|
|
1642
|
+
# Rack::Mime.mime_type('.foo')
|
|
1643
|
+
#
|
|
1644
|
+
# This is a shortcut for:
|
|
1645
|
+
# Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')
|
|
1646
|
+
#
|
|
1647
|
+
# pkg:gem/rack#lib/rack/mime.rb:21
|
|
1648
|
+
def mime_type(ext, fallback = T.unsafe(nil)); end
|
|
1649
|
+
end
|
|
1650
|
+
end
|
|
1651
|
+
|
|
1652
|
+
# List of most common mime-types, selected various sources
|
|
1653
|
+
# according to their usefulness in a webserving scope for Ruby
|
|
1654
|
+
# users.
|
|
1655
|
+
#
|
|
1656
|
+
# To amend this list with your local mime.types list you can use:
|
|
1657
|
+
#
|
|
1658
|
+
# require 'webrick/httputils'
|
|
1659
|
+
# list = WEBrick::HTTPUtils.load_mime_types('/etc/mime.types')
|
|
1660
|
+
# Rack::Mime::MIME_TYPES.merge!(list)
|
|
1661
|
+
#
|
|
1662
|
+
# N.B. On Ubuntu the mime.types file does not include the leading period, so
|
|
1663
|
+
# users may need to modify the data before merging into the hash.
|
|
1664
|
+
#
|
|
1665
|
+
# pkg:gem/rack#lib/rack/mime.rb:51
|
|
1666
|
+
Rack::Mime::MIME_TYPES = T.let(T.unsafe(nil), Hash)
|
|
1667
|
+
|
|
1668
|
+
# Rack::MockRequest helps testing your Rack application without
|
|
1669
|
+
# actually using HTTP.
|
|
1670
|
+
#
|
|
1671
|
+
# After performing a request on a URL with get/post/put/patch/delete, it
|
|
1672
|
+
# returns a MockResponse with useful helper methods for effective
|
|
1673
|
+
# testing.
|
|
1674
|
+
#
|
|
1675
|
+
# You can pass a hash with additional configuration to the
|
|
1676
|
+
# get/post/put/patch/delete.
|
|
1677
|
+
# <tt>:input</tt>:: A String or IO-like to be used as rack.input.
|
|
1678
|
+
# <tt>:fatal</tt>:: Raise a FatalWarning if the app writes to rack.errors.
|
|
1679
|
+
# <tt>:lint</tt>:: If true, wrap the application in a Rack::Lint.
|
|
1680
|
+
#
|
|
1681
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:23
|
|
1682
|
+
class Rack::MockRequest
|
|
1683
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:44
|
|
1684
|
+
def initialize(app); end
|
|
1685
|
+
|
|
1686
|
+
# Make a DELETE request and return a MockResponse. See #request.
|
|
1687
|
+
#
|
|
1688
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:57
|
|
1689
|
+
def delete(uri, opts = T.unsafe(nil)); end
|
|
1690
|
+
|
|
1691
|
+
# Make a GET request and return a MockResponse. See #request.
|
|
1692
|
+
#
|
|
1693
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:49
|
|
1694
|
+
def get(uri, opts = T.unsafe(nil)); end
|
|
1695
|
+
|
|
1696
|
+
# Make a HEAD request and return a MockResponse. See #request.
|
|
1697
|
+
#
|
|
1698
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:59
|
|
1699
|
+
def head(uri, opts = T.unsafe(nil)); end
|
|
1700
|
+
|
|
1701
|
+
# Make an OPTIONS request and return a MockResponse. See #request.
|
|
1702
|
+
#
|
|
1703
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:61
|
|
1704
|
+
def options(uri, opts = T.unsafe(nil)); end
|
|
1705
|
+
|
|
1706
|
+
# Make a PATCH request and return a MockResponse. See #request.
|
|
1707
|
+
#
|
|
1708
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:55
|
|
1709
|
+
def patch(uri, opts = T.unsafe(nil)); end
|
|
1710
|
+
|
|
1711
|
+
# Make a POST request and return a MockResponse. See #request.
|
|
1712
|
+
#
|
|
1713
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:51
|
|
1714
|
+
def post(uri, opts = T.unsafe(nil)); end
|
|
1715
|
+
|
|
1716
|
+
# Make a PUT request and return a MockResponse. See #request.
|
|
1717
|
+
#
|
|
1718
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:53
|
|
1719
|
+
def put(uri, opts = T.unsafe(nil)); end
|
|
1720
|
+
|
|
1721
|
+
# Make a request using the given request method for the given
|
|
1722
|
+
# uri to the rack application and return a MockResponse.
|
|
1723
|
+
# Options given are passed to MockRequest.env_for.
|
|
1724
|
+
#
|
|
1725
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:66
|
|
1726
|
+
def request(method = T.unsafe(nil), uri = T.unsafe(nil), opts = T.unsafe(nil)); end
|
|
1727
|
+
|
|
1728
|
+
class << self
|
|
1729
|
+
# Return the Rack environment used for a request to +uri+.
|
|
1730
|
+
# All options that are strings are added to the returned environment.
|
|
1731
|
+
# Options:
|
|
1732
|
+
# :fatal :: Whether to raise an exception if request outputs to rack.errors
|
|
1733
|
+
# :input :: The rack.input to set
|
|
1734
|
+
# :http_version :: The SERVER_PROTOCOL to set
|
|
1735
|
+
# :method :: The HTTP request method to use
|
|
1736
|
+
# :params :: The params to use
|
|
1737
|
+
# :script_name :: The SCRIPT_NAME to set
|
|
1738
|
+
#
|
|
1739
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:98
|
|
1740
|
+
def env_for(uri = T.unsafe(nil), opts = T.unsafe(nil)); end
|
|
1741
|
+
|
|
1742
|
+
# For historical reasons, we're pinning to RFC 2396.
|
|
1743
|
+
# URI::Parser = URI::RFC2396_Parser
|
|
1744
|
+
#
|
|
1745
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:84
|
|
1746
|
+
def parse_uri_rfc2396(uri); end
|
|
1747
|
+
end
|
|
1748
|
+
end
|
|
1749
|
+
|
|
1750
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:27
|
|
1751
|
+
class Rack::MockRequest::FatalWarner
|
|
1752
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:36
|
|
1753
|
+
def flush; end
|
|
1754
|
+
|
|
1755
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:28
|
|
1756
|
+
def puts(warning); end
|
|
1757
|
+
|
|
1758
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:39
|
|
1759
|
+
def string; end
|
|
1760
|
+
|
|
1761
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:32
|
|
1762
|
+
def write(warning); end
|
|
1763
|
+
end
|
|
1764
|
+
|
|
1765
|
+
# pkg:gem/rack#lib/rack/mock_request.rb:24
|
|
1766
|
+
class Rack::MockRequest::FatalWarning < ::RuntimeError; end
|
|
1767
|
+
|
|
1768
|
+
# Rack::MockResponse provides useful helpers for testing your apps.
|
|
1769
|
+
# Usually, you don't create the MockResponse on your own, but use
|
|
1770
|
+
# MockRequest.
|
|
1771
|
+
#
|
|
1772
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:13
|
|
1773
|
+
class Rack::MockResponse < ::Rack::Response
|
|
1774
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:48
|
|
1775
|
+
def initialize(status, headers, body, errors = T.unsafe(nil)); end
|
|
1776
|
+
|
|
1777
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:63
|
|
1778
|
+
def =~(other); end
|
|
1779
|
+
|
|
1780
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:71
|
|
1781
|
+
def body; end
|
|
1782
|
+
|
|
1783
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:105
|
|
1784
|
+
def cookie(name); end
|
|
1785
|
+
|
|
1786
|
+
# Headers
|
|
1787
|
+
#
|
|
1788
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:43
|
|
1789
|
+
def cookies; end
|
|
1790
|
+
|
|
1791
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:101
|
|
1792
|
+
def empty?; end
|
|
1793
|
+
|
|
1794
|
+
# Errors
|
|
1795
|
+
#
|
|
1796
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:46
|
|
1797
|
+
def errors; end
|
|
1798
|
+
|
|
1799
|
+
# Errors
|
|
1800
|
+
#
|
|
1801
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:46
|
|
1802
|
+
def errors=(_arg0); end
|
|
1803
|
+
|
|
1804
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:67
|
|
1805
|
+
def match(other); end
|
|
1806
|
+
|
|
1807
|
+
# Headers
|
|
1808
|
+
#
|
|
1809
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:43
|
|
1810
|
+
def original_headers; end
|
|
1811
|
+
|
|
1812
|
+
private
|
|
1813
|
+
|
|
1814
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:132
|
|
1815
|
+
def identify_cookie_attributes(cookie_filling); end
|
|
1816
|
+
|
|
1817
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:111
|
|
1818
|
+
def parse_cookies_from_header; end
|
|
1819
|
+
|
|
1820
|
+
class << self
|
|
1821
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:39
|
|
1822
|
+
def [](*_arg0); end
|
|
1823
|
+
end
|
|
1824
|
+
end
|
|
1825
|
+
|
|
1826
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:14
|
|
1827
|
+
class Rack::MockResponse::Cookie
|
|
1828
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:17
|
|
1829
|
+
def initialize(args); end
|
|
1830
|
+
|
|
1831
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:15
|
|
1832
|
+
def domain; end
|
|
1833
|
+
|
|
1834
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:15
|
|
1835
|
+
def expires; end
|
|
1836
|
+
|
|
1837
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:26
|
|
1838
|
+
def method_missing(method_name, *args, **_arg2, &block); end
|
|
1839
|
+
|
|
1840
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:15
|
|
1841
|
+
def name; end
|
|
1842
|
+
|
|
1843
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:15
|
|
1844
|
+
def path; end
|
|
1845
|
+
|
|
1846
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:15
|
|
1847
|
+
def secure; end
|
|
1848
|
+
|
|
1849
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:15
|
|
1850
|
+
def value; end
|
|
1851
|
+
|
|
1852
|
+
private
|
|
1853
|
+
|
|
1854
|
+
# :nocov:
|
|
1855
|
+
#
|
|
1856
|
+
# pkg:gem/rack#lib/rack/mock_response.rb:33
|
|
1857
|
+
def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end
|
|
1858
|
+
end
|
|
1859
|
+
|
|
1860
|
+
# A multipart form data parser, adapted from IOWA.
|
|
1861
|
+
#
|
|
1862
|
+
# Usually, Rack::Request#POST takes care of calling this.
|
|
1863
|
+
#
|
|
1864
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:9
|
|
1865
|
+
module Rack::Multipart
|
|
1866
|
+
class << self
|
|
1867
|
+
# pkg:gem/rack#lib/rack/multipart.rb:72
|
|
1868
|
+
def build_multipart(params, first = T.unsafe(nil)); end
|
|
1869
|
+
|
|
1870
|
+
# pkg:gem/rack#lib/rack/multipart.rb:68
|
|
1871
|
+
def extract_multipart(request, params = T.unsafe(nil)); end
|
|
1872
|
+
|
|
1873
|
+
# pkg:gem/rack#lib/rack/multipart.rb:48
|
|
1874
|
+
def parse_multipart(env, params = T.unsafe(nil)); end
|
|
1875
|
+
end
|
|
1876
|
+
end
|
|
1877
|
+
|
|
1878
|
+
# Base class for multipart exceptions that do not subclass from
|
|
1879
|
+
# other exception classes for backwards compatibility.
|
|
1880
|
+
#
|
|
1881
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:26
|
|
1882
|
+
class Rack::Multipart::BoundaryTooLongError < ::StandardError
|
|
1883
|
+
include ::Rack::BadRequest
|
|
1884
|
+
end
|
|
1885
|
+
|
|
1886
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:33
|
|
1887
|
+
Rack::Multipart::EOL = T.let(T.unsafe(nil), String)
|
|
1888
|
+
|
|
1889
|
+
# Use specific error class when parsing multipart request
|
|
1890
|
+
# that ends early.
|
|
1891
|
+
#
|
|
1892
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:20
|
|
1893
|
+
class Rack::Multipart::EmptyContentError < ::EOFError
|
|
1894
|
+
include ::Rack::BadRequest
|
|
1895
|
+
end
|
|
1896
|
+
|
|
1897
|
+
# Prefer to use the BoundaryTooLongError class or Rack::BadRequest.
|
|
1898
|
+
#
|
|
1899
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:31
|
|
1900
|
+
Rack::Multipart::Error = Rack::Multipart::BoundaryTooLongError
|
|
1901
|
+
|
|
1902
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:34
|
|
1903
|
+
Rack::Multipart::FWS = T.let(T.unsafe(nil), Regexp)
|
|
1904
|
+
|
|
1905
|
+
# pkg:gem/rack#lib/rack/multipart/generator.rb:7
|
|
1906
|
+
class Rack::Multipart::Generator
|
|
1907
|
+
# pkg:gem/rack#lib/rack/multipart/generator.rb:8
|
|
1908
|
+
def initialize(params, first = T.unsafe(nil)); end
|
|
1909
|
+
|
|
1910
|
+
# pkg:gem/rack#lib/rack/multipart/generator.rb:16
|
|
1911
|
+
def dump; end
|
|
1912
|
+
|
|
1913
|
+
private
|
|
1914
|
+
|
|
1915
|
+
# pkg:gem/rack#lib/rack/multipart/generator.rb:89
|
|
1916
|
+
def content_for_other(file, name); end
|
|
1917
|
+
|
|
1918
|
+
# pkg:gem/rack#lib/rack/multipart/generator.rb:77
|
|
1919
|
+
def content_for_tempfile(io, file, name); end
|
|
1920
|
+
|
|
1921
|
+
# pkg:gem/rack#lib/rack/multipart/generator.rb:52
|
|
1922
|
+
def flattened_params; end
|
|
1923
|
+
|
|
1924
|
+
# pkg:gem/rack#lib/rack/multipart/generator.rb:37
|
|
1925
|
+
def multipart?; end
|
|
1926
|
+
end
|
|
1927
|
+
|
|
1928
|
+
# whitespace with optional folding
|
|
1929
|
+
#
|
|
1930
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:35
|
|
1931
|
+
Rack::Multipart::HEADER_VALUE = T.let(T.unsafe(nil), String)
|
|
1932
|
+
|
|
1933
|
+
# anything but a non-folding CRLF
|
|
1934
|
+
#
|
|
1935
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:36
|
|
1936
|
+
Rack::Multipart::MULTIPART = T.let(T.unsafe(nil), Regexp)
|
|
1937
|
+
|
|
1938
|
+
# pkg:gem/rack#lib/rack/multipart.rb:16
|
|
1939
|
+
Rack::Multipart::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
|
|
1940
|
+
|
|
1941
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:38
|
|
1942
|
+
Rack::Multipart::MULTIPART_CONTENT_DISPOSITION = T.let(T.unsafe(nil), Regexp)
|
|
1943
|
+
|
|
1944
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:39
|
|
1945
|
+
Rack::Multipart::MULTIPART_CONTENT_ID = T.let(T.unsafe(nil), Regexp)
|
|
1946
|
+
|
|
1947
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:37
|
|
1948
|
+
Rack::Multipart::MULTIPART_CONTENT_TYPE = T.let(T.unsafe(nil), Regexp)
|
|
1949
|
+
|
|
1950
|
+
# pkg:gem/rack#lib/rack/multipart.rb:18
|
|
1951
|
+
class Rack::Multipart::MissingInputError < ::StandardError
|
|
1952
|
+
include ::Rack::BadRequest
|
|
1953
|
+
end
|
|
1954
|
+
|
|
1955
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:10
|
|
1956
|
+
class Rack::Multipart::MultipartPartLimitError < ::Errno::EMFILE
|
|
1957
|
+
include ::Rack::BadRequest
|
|
1958
|
+
end
|
|
1959
|
+
|
|
1960
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:14
|
|
1961
|
+
class Rack::Multipart::MultipartTotalPartLimitError < ::StandardError
|
|
1962
|
+
include ::Rack::BadRequest
|
|
1963
|
+
end
|
|
1964
|
+
|
|
1965
|
+
# Accumulator for multipart form data, conforming to the QueryParser API.
|
|
1966
|
+
# In future, the Parser could return the pair list directly, but that would
|
|
1967
|
+
# change its API.
|
|
1968
|
+
#
|
|
1969
|
+
# pkg:gem/rack#lib/rack/multipart.rb:25
|
|
1970
|
+
class Rack::Multipart::ParamList
|
|
1971
|
+
# pkg:gem/rack#lib/rack/multipart.rb:34
|
|
1972
|
+
def initialize; end
|
|
1973
|
+
|
|
1974
|
+
# pkg:gem/rack#lib/rack/multipart.rb:38
|
|
1975
|
+
def <<(pair); end
|
|
1976
|
+
|
|
1977
|
+
# pkg:gem/rack#lib/rack/multipart.rb:42
|
|
1978
|
+
def to_params_hash; end
|
|
1979
|
+
|
|
1980
|
+
class << self
|
|
1981
|
+
# pkg:gem/rack#lib/rack/multipart.rb:26
|
|
1982
|
+
def make_params; end
|
|
1983
|
+
|
|
1984
|
+
# pkg:gem/rack#lib/rack/multipart.rb:30
|
|
1985
|
+
def normalize_params(params, key, value); end
|
|
1986
|
+
end
|
|
1987
|
+
end
|
|
1988
|
+
|
|
1989
|
+
# Rack::Multipart::Parser handles parsing of multipart/form-data requests.
|
|
1990
|
+
#
|
|
1991
|
+
# File Parameter Contents
|
|
1992
|
+
#
|
|
1993
|
+
# When processing file uploads, the parser returns a hash containing
|
|
1994
|
+
# information about uploaded files. For +file+ parameters, the hash includes:
|
|
1995
|
+
#
|
|
1996
|
+
# * +:filename+ - The original filename, already URL decoded by the parser
|
|
1997
|
+
# * +:type+ - The content type of the uploaded file
|
|
1998
|
+
# * +:name+ - The parameter name from the form
|
|
1999
|
+
# * +:tempfile+ - A Tempfile object containing the uploaded data
|
|
2000
|
+
# * +:head+ - The raw header content for this part
|
|
2001
|
+
#
|
|
2002
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:53
|
|
2003
|
+
class Rack::Multipart::Parser
|
|
2004
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:254
|
|
2005
|
+
def initialize(boundary, tempfile, bufsize, query_parser); end
|
|
2006
|
+
|
|
2007
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:275
|
|
2008
|
+
def parse(io); end
|
|
2009
|
+
|
|
2010
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:299
|
|
2011
|
+
def result; end
|
|
2012
|
+
|
|
2013
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:252
|
|
2014
|
+
def state; end
|
|
2015
|
+
|
|
2016
|
+
private
|
|
2017
|
+
|
|
2018
|
+
# Scan until the we find the start or end of the boundary.
|
|
2019
|
+
# If we find it, return the appropriate symbol for the start or
|
|
2020
|
+
# end of the boundary. If we don't find the start or end of the
|
|
2021
|
+
# boundary, clear the buffer and return nil.
|
|
2022
|
+
#
|
|
2023
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:534
|
|
2024
|
+
def consume_boundary; end
|
|
2025
|
+
|
|
2026
|
+
# Return the related Encoding object. However, because
|
|
2027
|
+
# enc is submitted by the user, it may be invalid, so
|
|
2028
|
+
# use a binary encoding in that case.
|
|
2029
|
+
#
|
|
2030
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:589
|
|
2031
|
+
def find_encoding(enc); end
|
|
2032
|
+
|
|
2033
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:358
|
|
2034
|
+
def handle_consume_token; end
|
|
2035
|
+
|
|
2036
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:604
|
|
2037
|
+
def handle_dummy_encoding(name, body); end
|
|
2038
|
+
|
|
2039
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:614
|
|
2040
|
+
def handle_empty_content!(content); end
|
|
2041
|
+
|
|
2042
|
+
# This handles the initial parser state. We read until we find the starting
|
|
2043
|
+
# boundary, then we can transition to the next state. If we find the ending
|
|
2044
|
+
# boundary, this is an invalid multipart upload, but keep scanning for opening
|
|
2045
|
+
# boundary in that case. If no boundary found, we need to keep reading data
|
|
2046
|
+
# and retry. It's highly unlikely the initial read will not consume the
|
|
2047
|
+
# boundary. The client would have to deliberately craft a response
|
|
2048
|
+
# with the opening boundary beyond the buffer size for that to happen.
|
|
2049
|
+
#
|
|
2050
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:331
|
|
2051
|
+
def handle_fast_forward; end
|
|
2052
|
+
|
|
2053
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:501
|
|
2054
|
+
def handle_mime_body; end
|
|
2055
|
+
|
|
2056
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:373
|
|
2057
|
+
def handle_mime_head; end
|
|
2058
|
+
|
|
2059
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:543
|
|
2060
|
+
def normalize_filename(filename); end
|
|
2061
|
+
|
|
2062
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:312
|
|
2063
|
+
def read_data(io, outbuf); end
|
|
2064
|
+
|
|
2065
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:556
|
|
2066
|
+
def tag_multipart_encoding(filename, content_type, name, body); end
|
|
2067
|
+
|
|
2068
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:523
|
|
2069
|
+
def update_retained_size(size); end
|
|
2070
|
+
|
|
2071
|
+
class << self
|
|
2072
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:137
|
|
2073
|
+
def parse(io, content_length, content_type, tmpfile, bufsize, qp); end
|
|
2074
|
+
|
|
2075
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:122
|
|
2076
|
+
def parse_boundary(content_type); end
|
|
2077
|
+
end
|
|
2078
|
+
end
|
|
2079
|
+
|
|
2080
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:62
|
|
2081
|
+
Rack::Multipart::Parser::BOUNDARY_START_LIMIT = T.let(T.unsafe(nil), Integer)
|
|
2082
|
+
|
|
2083
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:80
|
|
2084
|
+
Rack::Multipart::Parser::BUFFERED_UPLOAD_BYTESIZE_LIMIT = T.let(T.unsafe(nil), Integer)
|
|
2085
|
+
|
|
2086
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:54
|
|
2087
|
+
Rack::Multipart::Parser::BUFSIZE = T.let(T.unsafe(nil), Integer)
|
|
2088
|
+
|
|
2089
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:90
|
|
2090
|
+
class Rack::Multipart::Parser::BoundedIO
|
|
2091
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:91
|
|
2092
|
+
def initialize(io, content_length); end
|
|
2093
|
+
|
|
2094
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:97
|
|
2095
|
+
def read(size, outbuf = T.unsafe(nil)); end
|
|
2096
|
+
end
|
|
2097
|
+
|
|
2098
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:553
|
|
2099
|
+
Rack::Multipart::Parser::CHARSET = T.let(T.unsafe(nil), String)
|
|
2100
|
+
|
|
2101
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:369
|
|
2102
|
+
Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_BYTES = T.let(T.unsafe(nil), Integer)
|
|
2103
|
+
|
|
2104
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:368
|
|
2105
|
+
Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_PARAMS = T.let(T.unsafe(nil), Integer)
|
|
2106
|
+
|
|
2107
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:87
|
|
2108
|
+
Rack::Multipart::Parser::CONTENT_DISPOSITION_QUOTED_ESCAPES_LIMIT = T.let(T.unsafe(nil), Integer)
|
|
2109
|
+
|
|
2110
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:161
|
|
2111
|
+
class Rack::Multipart::Parser::Collector
|
|
2112
|
+
include ::Enumerable
|
|
2113
|
+
|
|
2114
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:197
|
|
2115
|
+
def initialize(tempfile); end
|
|
2116
|
+
|
|
2117
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:203
|
|
2118
|
+
def each; end
|
|
2119
|
+
|
|
2120
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:223
|
|
2121
|
+
def on_mime_body(mime_index, content); end
|
|
2122
|
+
|
|
2123
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:227
|
|
2124
|
+
def on_mime_finish(mime_index); end
|
|
2125
|
+
|
|
2126
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:207
|
|
2127
|
+
def on_mime_head(mime_index, head, filename, content_type, name); end
|
|
2128
|
+
|
|
2129
|
+
private
|
|
2130
|
+
|
|
2131
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:232
|
|
2132
|
+
def check_part_limits; end
|
|
2133
|
+
end
|
|
2134
|
+
|
|
2135
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:185
|
|
2136
|
+
class Rack::Multipart::Parser::Collector::BufferPart < ::Rack::Multipart::Parser::Collector::MimePart
|
|
2137
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:187
|
|
2138
|
+
def close; end
|
|
2139
|
+
|
|
2140
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:186
|
|
2141
|
+
def file?; end
|
|
2142
|
+
end
|
|
2143
|
+
|
|
2144
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:162
|
|
2145
|
+
class Rack::Multipart::Parser::Collector::MimePart < ::Struct
|
|
2146
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:163
|
|
2147
|
+
def get_data; end
|
|
2148
|
+
end
|
|
2149
|
+
|
|
2150
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:190
|
|
2151
|
+
class Rack::Multipart::Parser::Collector::TempfilePart < ::Rack::Multipart::Parser::Collector::MimePart
|
|
2152
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:192
|
|
2153
|
+
def close; end
|
|
2154
|
+
|
|
2155
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:191
|
|
2156
|
+
def file?; end
|
|
2157
|
+
end
|
|
2158
|
+
|
|
2159
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:120
|
|
2160
|
+
Rack::Multipart::Parser::EMPTY = T.let(T.unsafe(nil), Rack::Multipart::Parser::MultipartInfo)
|
|
2161
|
+
|
|
2162
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:65
|
|
2163
|
+
Rack::Multipart::Parser::MIME_HEADER_BYTESIZE_LIMIT = T.let(T.unsafe(nil), Integer)
|
|
2164
|
+
|
|
2165
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:119
|
|
2166
|
+
class Rack::Multipart::Parser::MultipartInfo < ::Struct
|
|
2167
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:119
|
|
2168
|
+
def params; end
|
|
2169
|
+
|
|
2170
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:119
|
|
2171
|
+
def params=(_); end
|
|
2172
|
+
|
|
2173
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:119
|
|
2174
|
+
def tmp_files; end
|
|
2175
|
+
|
|
2176
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:119
|
|
2177
|
+
def tmp_files=(_); end
|
|
2178
|
+
|
|
2179
|
+
class << self
|
|
2180
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:119
|
|
2181
|
+
def [](*_arg0); end
|
|
2182
|
+
|
|
2183
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:119
|
|
2184
|
+
def inspect; end
|
|
2185
|
+
|
|
2186
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:119
|
|
2187
|
+
def keyword_init?; end
|
|
2188
|
+
|
|
2189
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:119
|
|
2190
|
+
def members; end
|
|
2191
|
+
|
|
2192
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:119
|
|
2193
|
+
def new(*_arg0); end
|
|
2194
|
+
end
|
|
2195
|
+
end
|
|
2196
|
+
|
|
2197
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:370
|
|
2198
|
+
Rack::Multipart::Parser::OBS_UNFOLD = T.let(T.unsafe(nil), Regexp)
|
|
2199
|
+
|
|
2200
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:84
|
|
2201
|
+
Rack::Multipart::Parser::PARSER_BYTESIZE_LIMIT = T.let(T.unsafe(nil), Integer)
|
|
2202
|
+
|
|
2203
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:595
|
|
2204
|
+
Rack::Multipart::Parser::REENCODE_DUMMY_ENCODINGS = T.let(T.unsafe(nil), Hash)
|
|
2205
|
+
|
|
2206
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:56
|
|
2207
|
+
Rack::Multipart::Parser::TEMPFILE_FACTORY = T.let(T.unsafe(nil), Proc)
|
|
2208
|
+
|
|
2209
|
+
# pkg:gem/rack#lib/rack/multipart/parser.rb:55
|
|
2210
|
+
Rack::Multipart::Parser::TEXT_PLAIN = T.let(T.unsafe(nil), String)
|
|
2211
|
+
|
|
2212
|
+
# Despite the misleading name, UploadedFile is designed for use for
|
|
2213
|
+
# preparing multipart file upload bodies, generally for use in tests.
|
|
2214
|
+
# It is not designed for and should not be used for handling uploaded
|
|
2215
|
+
# files (there is no need for that, since Rack's multipart parser
|
|
2216
|
+
# already creates Tempfiles for that). Using this with non-trusted
|
|
2217
|
+
# filenames can create a security vulnerability.
|
|
2218
|
+
#
|
|
2219
|
+
# You should only use this class if you plan on passing the instances
|
|
2220
|
+
# to Rack::MockRequest for use in creating multipart request bodies.
|
|
2221
|
+
#
|
|
2222
|
+
# UploadedFile delegates most methods to the tempfile it contains.
|
|
2223
|
+
#
|
|
2224
|
+
# pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:19
|
|
2225
|
+
class Rack::Multipart::UploadedFile
|
|
2226
|
+
# Create a new UploadedFile. For backwards compatibility, this accepts
|
|
2227
|
+
# both positional and keyword versions of the same arguments:
|
|
2228
|
+
#
|
|
2229
|
+
# filepath/path :: The path to the file
|
|
2230
|
+
# ct/content_type :: The content_type of the file
|
|
2231
|
+
# bin/binary :: Whether to set binmode on the file before copying data into it.
|
|
2232
|
+
#
|
|
2233
|
+
# If both positional and keyword arguments are present, the keyword arguments
|
|
2234
|
+
# take precedence.
|
|
2235
|
+
#
|
|
2236
|
+
# The following keyword-only arguments are also accepted:
|
|
2237
|
+
#
|
|
2238
|
+
# filename :: Override the filename to use for the file. This is so the
|
|
2239
|
+
# filename for the upload does not need to match the basename of
|
|
2240
|
+
# the file path. This should not contain slashes, unless you are
|
|
2241
|
+
# trying to test how an application handles invalid filenames in
|
|
2242
|
+
# multipart upload bodies.
|
|
2243
|
+
# io :: Use the given IO-like instance as the tempfile, instead of creating
|
|
2244
|
+
# a Tempfile instance. This is useful for building multipart file
|
|
2245
|
+
# upload bodies without a file being present on the filesystem. If you are
|
|
2246
|
+
# providing this, you should also provide the filename argument.
|
|
2247
|
+
#
|
|
2248
|
+
# pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:49
|
|
2249
|
+
def initialize(filepath = T.unsafe(nil), ct = T.unsafe(nil), bin = T.unsafe(nil), path: T.unsafe(nil), content_type: T.unsafe(nil), binary: T.unsafe(nil), filename: T.unsafe(nil), io: T.unsafe(nil)); end
|
|
2250
|
+
|
|
2251
|
+
# The content type of the instance.
|
|
2252
|
+
#
|
|
2253
|
+
# pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:26
|
|
2254
|
+
def content_type; end
|
|
2255
|
+
|
|
2256
|
+
# The content type of the instance.
|
|
2257
|
+
#
|
|
2258
|
+
# pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:26
|
|
2259
|
+
def content_type=(_arg0); end
|
|
2260
|
+
|
|
2261
|
+
# pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:69
|
|
2262
|
+
def local_path; end
|
|
2263
|
+
|
|
2264
|
+
# Delegate method missing calls to the tempfile.
|
|
2265
|
+
#
|
|
2266
|
+
# pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:77
|
|
2267
|
+
def method_missing(method_name, *args, &block); end
|
|
2268
|
+
|
|
2269
|
+
# The provided name of the file. This generally is the basename of
|
|
2270
|
+
# path provided during initialization, but it can contain slashes if they
|
|
2271
|
+
# were present in the filename argument when the instance was created.
|
|
2272
|
+
#
|
|
2273
|
+
# pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:23
|
|
2274
|
+
def original_filename; end
|
|
2275
|
+
|
|
2276
|
+
# The path of the tempfile for the instance, if the tempfile has a path.
|
|
2277
|
+
# nil if the tempfile does not have a path.
|
|
2278
|
+
#
|
|
2279
|
+
# pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:66
|
|
2280
|
+
def path; end
|
|
2281
|
+
|
|
2282
|
+
private
|
|
2283
|
+
|
|
2284
|
+
# Return true if the tempfile responds to the method.
|
|
2285
|
+
#
|
|
2286
|
+
# pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:72
|
|
2287
|
+
def respond_to_missing?(*args); end
|
|
2288
|
+
end
|
|
2289
|
+
|
|
2290
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:6
|
|
2291
|
+
class Rack::NullLogger
|
|
2292
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:7
|
|
2293
|
+
def initialize(app); end
|
|
2294
|
+
|
|
2295
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:45
|
|
2296
|
+
def <<(msg); end
|
|
2297
|
+
|
|
2298
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:43
|
|
2299
|
+
def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end
|
|
2300
|
+
|
|
2301
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:11
|
|
2302
|
+
def call(env); end
|
|
2303
|
+
|
|
2304
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:42
|
|
2305
|
+
def close; end
|
|
2306
|
+
|
|
2307
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:34
|
|
2308
|
+
def datetime_format; end
|
|
2309
|
+
|
|
2310
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:39
|
|
2311
|
+
def datetime_format=(datetime_format); end
|
|
2312
|
+
|
|
2313
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:17
|
|
2314
|
+
def debug(progname = T.unsafe(nil), &block); end
|
|
2315
|
+
|
|
2316
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:27
|
|
2317
|
+
def debug!; end
|
|
2318
|
+
|
|
2319
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:23
|
|
2320
|
+
def debug?; end
|
|
2321
|
+
|
|
2322
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:19
|
|
2323
|
+
def error(progname = T.unsafe(nil), &block); end
|
|
2324
|
+
|
|
2325
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:28
|
|
2326
|
+
def error!; end
|
|
2327
|
+
|
|
2328
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:25
|
|
2329
|
+
def error?; end
|
|
2330
|
+
|
|
2331
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:20
|
|
2332
|
+
def fatal(progname = T.unsafe(nil), &block); end
|
|
2333
|
+
|
|
2334
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:29
|
|
2335
|
+
def fatal!; end
|
|
2336
|
+
|
|
2337
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:26
|
|
2338
|
+
def fatal?; end
|
|
2339
|
+
|
|
2340
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:35
|
|
2341
|
+
def formatter; end
|
|
2342
|
+
|
|
2343
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:40
|
|
2344
|
+
def formatter=(formatter); end
|
|
2345
|
+
|
|
2346
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:16
|
|
2347
|
+
def info(progname = T.unsafe(nil), &block); end
|
|
2348
|
+
|
|
2349
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:30
|
|
2350
|
+
def info!; end
|
|
2351
|
+
|
|
2352
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:22
|
|
2353
|
+
def info?; end
|
|
2354
|
+
|
|
2355
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:32
|
|
2356
|
+
def level; end
|
|
2357
|
+
|
|
2358
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:37
|
|
2359
|
+
def level=(level); end
|
|
2360
|
+
|
|
2361
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:44
|
|
2362
|
+
def log(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end
|
|
2363
|
+
|
|
2364
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:33
|
|
2365
|
+
def progname; end
|
|
2366
|
+
|
|
2367
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:38
|
|
2368
|
+
def progname=(progname); end
|
|
2369
|
+
|
|
2370
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:46
|
|
2371
|
+
def reopen(logdev = T.unsafe(nil)); end
|
|
2372
|
+
|
|
2373
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:36
|
|
2374
|
+
def sev_threshold; end
|
|
2375
|
+
|
|
2376
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:41
|
|
2377
|
+
def sev_threshold=(sev_threshold); end
|
|
2378
|
+
|
|
2379
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:21
|
|
2380
|
+
def unknown(progname = T.unsafe(nil), &block); end
|
|
2381
|
+
|
|
2382
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:18
|
|
2383
|
+
def warn(progname = T.unsafe(nil), &block); end
|
|
2384
|
+
|
|
2385
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:31
|
|
2386
|
+
def warn!; end
|
|
2387
|
+
|
|
2388
|
+
# pkg:gem/rack#lib/rack/null_logger.rb:24
|
|
2389
|
+
def warn?; end
|
|
2390
|
+
end
|
|
2391
|
+
|
|
2392
|
+
# pkg:gem/rack#lib/rack/constants.rb:34
|
|
2393
|
+
Rack::OPTIONS = T.let(T.unsafe(nil), String)
|
|
2394
|
+
|
|
2395
|
+
# pkg:gem/rack#lib/rack/constants.rb:31
|
|
2396
|
+
Rack::PATCH = T.let(T.unsafe(nil), String)
|
|
2397
|
+
|
|
2398
|
+
# pkg:gem/rack#lib/rack/constants.rb:8
|
|
2399
|
+
Rack::PATH_INFO = T.let(T.unsafe(nil), String)
|
|
2400
|
+
|
|
2401
|
+
# pkg:gem/rack#lib/rack/constants.rb:29
|
|
2402
|
+
Rack::POST = T.let(T.unsafe(nil), String)
|
|
2403
|
+
|
|
2404
|
+
# pkg:gem/rack#lib/rack/constants.rb:30
|
|
2405
|
+
Rack::PUT = T.let(T.unsafe(nil), String)
|
|
2406
|
+
|
|
2407
|
+
# pkg:gem/rack#lib/rack/constants.rb:12
|
|
2408
|
+
Rack::QUERY_STRING = T.let(T.unsafe(nil), String)
|
|
2409
|
+
|
|
2410
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:7
|
|
2411
|
+
class Rack::QueryParser
|
|
2412
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:62
|
|
2413
|
+
def initialize(params_class, param_depth_limit, bytesize_limit: T.unsafe(nil), params_limit: T.unsafe(nil)); end
|
|
2414
|
+
|
|
2415
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:60
|
|
2416
|
+
def bytesize_limit; end
|
|
2417
|
+
|
|
2418
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:196
|
|
2419
|
+
def make_params; end
|
|
2420
|
+
|
|
2421
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:200
|
|
2422
|
+
def new_depth_limit(param_depth_limit); end
|
|
2423
|
+
|
|
2424
|
+
# normalize_params recursively expands parameters into structural types. If
|
|
2425
|
+
# the structural types represented by two different parameter names are in
|
|
2426
|
+
# conflict, a ParameterTypeError is raised. The depth argument is deprecated
|
|
2427
|
+
# and should no longer be used, it is kept for backwards compatibility with
|
|
2428
|
+
# earlier versions of rack.
|
|
2429
|
+
#
|
|
2430
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:124
|
|
2431
|
+
def normalize_params(params, name, v, _depth = T.unsafe(nil)); end
|
|
2432
|
+
|
|
2433
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:40
|
|
2434
|
+
def param_depth_limit; end
|
|
2435
|
+
|
|
2436
|
+
# parse_nested_query expands a query string into structural types. Supported
|
|
2437
|
+
# types are Arrays, Hashes and basic value types. It is possible to supply
|
|
2438
|
+
# query strings with parameters of conflicting types, in this case a
|
|
2439
|
+
# ParameterTypeError is raised. Users are encouraged to return a 400 in this
|
|
2440
|
+
# case.
|
|
2441
|
+
#
|
|
2442
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:109
|
|
2443
|
+
def parse_nested_query(qs, separator = T.unsafe(nil)); end
|
|
2444
|
+
|
|
2445
|
+
# Stolen from Mongrel, with some small modifications:
|
|
2446
|
+
# Parses a query string by breaking it up at the '&'. You can also use this
|
|
2447
|
+
# to parse cookies by changing the characters used in the second parameter
|
|
2448
|
+
# (which defaults to '&').
|
|
2449
|
+
#
|
|
2450
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:73
|
|
2451
|
+
def parse_query(qs, separator = T.unsafe(nil), &unescaper); end
|
|
2452
|
+
|
|
2453
|
+
# Parses a query string by breaking it up at the '&', returning all key-value
|
|
2454
|
+
# pairs as an array of [key, value] arrays. Unlike parse_query, this preserves
|
|
2455
|
+
# all duplicate keys rather than collapsing them.
|
|
2456
|
+
#
|
|
2457
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:94
|
|
2458
|
+
def parse_query_pairs(qs, separator = T.unsafe(nil)); end
|
|
2459
|
+
|
|
2460
|
+
private
|
|
2461
|
+
|
|
2462
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:128
|
|
2463
|
+
def _normalize_params(params, name, v, depth); end
|
|
2464
|
+
|
|
2465
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:222
|
|
2466
|
+
def each_query_pair(qs, separator, unescaper = T.unsafe(nil)); end
|
|
2467
|
+
|
|
2468
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:210
|
|
2469
|
+
def params_hash_has_key?(hash, key); end
|
|
2470
|
+
|
|
2471
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:206
|
|
2472
|
+
def params_hash_type?(obj); end
|
|
2473
|
+
|
|
2474
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:253
|
|
2475
|
+
def unescape(string, encoding = T.unsafe(nil)); end
|
|
2476
|
+
|
|
2477
|
+
class << self
|
|
2478
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:36
|
|
2479
|
+
def make_default(param_depth_limit, **options); end
|
|
2480
|
+
end
|
|
2481
|
+
end
|
|
2482
|
+
|
|
2483
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:54
|
|
2484
|
+
Rack::QueryParser::BYTESIZE_LIMIT = T.let(T.unsafe(nil), Integer)
|
|
2485
|
+
|
|
2486
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:9
|
|
2487
|
+
Rack::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash)
|
|
2488
|
+
|
|
2489
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:8
|
|
2490
|
+
Rack::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
|
|
2491
|
+
|
|
2492
|
+
# InvalidParameterError is the error that is raised when incoming structural
|
|
2493
|
+
# parameters (parsed by parse_nested_query) contain invalid format or byte
|
|
2494
|
+
# sequence.
|
|
2495
|
+
#
|
|
2496
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:20
|
|
2497
|
+
class Rack::QueryParser::InvalidParameterError < ::ArgumentError
|
|
2498
|
+
include ::Rack::BadRequest
|
|
2499
|
+
end
|
|
2500
|
+
|
|
2501
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:57
|
|
2502
|
+
Rack::QueryParser::PARAMS_LIMIT = T.let(T.unsafe(nil), Integer)
|
|
2503
|
+
|
|
2504
|
+
# ParameterTypeError is the error that is raised when incoming structural
|
|
2505
|
+
# parameters (parsed by parse_nested_query) contain conflicting types.
|
|
2506
|
+
#
|
|
2507
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:13
|
|
2508
|
+
class Rack::QueryParser::ParameterTypeError < ::TypeError
|
|
2509
|
+
include ::Rack::BadRequest
|
|
2510
|
+
end
|
|
2511
|
+
|
|
2512
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:257
|
|
2513
|
+
class Rack::QueryParser::Params < ::Hash
|
|
2514
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:258
|
|
2515
|
+
def to_params_hash; end
|
|
2516
|
+
end
|
|
2517
|
+
|
|
2518
|
+
# ParamsTooDeepError is the old name for the error that is raised when params
|
|
2519
|
+
# are recursively nested over the specified limit. Make it the same as
|
|
2520
|
+
# as QueryLimitError, so that code that rescues ParamsTooDeepError error
|
|
2521
|
+
# to handle bad query strings also now handles other limits.
|
|
2522
|
+
#
|
|
2523
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:34
|
|
2524
|
+
Rack::QueryParser::ParamsTooDeepError = Rack::QueryParser::QueryLimitError
|
|
2525
|
+
|
|
2526
|
+
# QueryLimitError is for errors raised when the query provided exceeds one
|
|
2527
|
+
# of the query parser limits.
|
|
2528
|
+
#
|
|
2529
|
+
# pkg:gem/rack#lib/rack/query_parser.rb:26
|
|
2530
|
+
class Rack::QueryParser::QueryLimitError < ::RangeError
|
|
2531
|
+
include ::Rack::BadRequest
|
|
2532
|
+
end
|
|
2533
|
+
|
|
2534
|
+
# pkg:gem/rack#lib/rack/constants.rb:43
|
|
2535
|
+
Rack::RACK_EARLY_HINTS = T.let(T.unsafe(nil), String)
|
|
2536
|
+
|
|
2537
|
+
# pkg:gem/rack#lib/rack/constants.rb:44
|
|
2538
|
+
Rack::RACK_ERRORS = T.let(T.unsafe(nil), String)
|
|
2539
|
+
|
|
2540
|
+
# pkg:gem/rack#lib/rack/constants.rb:51
|
|
2541
|
+
Rack::RACK_HIJACK = T.let(T.unsafe(nil), String)
|
|
2542
|
+
|
|
2543
|
+
# pkg:gem/rack#lib/rack/constants.rb:46
|
|
2544
|
+
Rack::RACK_INPUT = T.let(T.unsafe(nil), String)
|
|
2545
|
+
|
|
2546
|
+
# pkg:gem/rack#lib/rack/constants.rb:52
|
|
2547
|
+
Rack::RACK_IS_HIJACK = T.let(T.unsafe(nil), String)
|
|
2548
|
+
|
|
2549
|
+
# pkg:gem/rack#lib/rack/constants.rb:45
|
|
2550
|
+
Rack::RACK_LOGGER = T.let(T.unsafe(nil), String)
|
|
2551
|
+
|
|
2552
|
+
# pkg:gem/rack#lib/rack/constants.rb:67
|
|
2553
|
+
Rack::RACK_METHODOVERRIDE_ORIGINAL_METHOD = T.let(T.unsafe(nil), String)
|
|
2554
|
+
|
|
2555
|
+
# pkg:gem/rack#lib/rack/constants.rb:54
|
|
2556
|
+
Rack::RACK_MULTIPART_BUFFER_SIZE = T.let(T.unsafe(nil), String)
|
|
2557
|
+
|
|
2558
|
+
# pkg:gem/rack#lib/rack/constants.rb:55
|
|
2559
|
+
Rack::RACK_MULTIPART_TEMPFILE_FACTORY = T.let(T.unsafe(nil), String)
|
|
2560
|
+
|
|
2561
|
+
# pkg:gem/rack#lib/rack/constants.rb:57
|
|
2562
|
+
Rack::RACK_PROTOCOL = T.let(T.unsafe(nil), String)
|
|
2563
|
+
|
|
2564
|
+
# pkg:gem/rack#lib/rack/constants.rb:53
|
|
2565
|
+
Rack::RACK_RECURSIVE_INCLUDE = T.let(T.unsafe(nil), String)
|
|
2566
|
+
|
|
2567
|
+
# pkg:gem/rack#lib/rack/constants.rb:63
|
|
2568
|
+
Rack::RACK_REQUEST_COOKIE_HASH = T.let(T.unsafe(nil), String)
|
|
2569
|
+
|
|
2570
|
+
# pkg:gem/rack#lib/rack/constants.rb:64
|
|
2571
|
+
Rack::RACK_REQUEST_COOKIE_STRING = T.let(T.unsafe(nil), String)
|
|
2572
|
+
|
|
2573
|
+
# pkg:gem/rack#lib/rack/constants.rb:62
|
|
2574
|
+
Rack::RACK_REQUEST_FORM_ERROR = T.let(T.unsafe(nil), String)
|
|
2575
|
+
|
|
2576
|
+
# pkg:gem/rack#lib/rack/constants.rb:59
|
|
2577
|
+
Rack::RACK_REQUEST_FORM_HASH = T.let(T.unsafe(nil), String)
|
|
2578
|
+
|
|
2579
|
+
# pkg:gem/rack#lib/rack/constants.rb:58
|
|
2580
|
+
Rack::RACK_REQUEST_FORM_INPUT = T.let(T.unsafe(nil), String)
|
|
2581
|
+
|
|
2582
|
+
# pkg:gem/rack#lib/rack/constants.rb:60
|
|
2583
|
+
Rack::RACK_REQUEST_FORM_PAIRS = T.let(T.unsafe(nil), String)
|
|
2584
|
+
|
|
2585
|
+
# pkg:gem/rack#lib/rack/constants.rb:61
|
|
2586
|
+
Rack::RACK_REQUEST_FORM_VARS = T.let(T.unsafe(nil), String)
|
|
2587
|
+
|
|
2588
|
+
# pkg:gem/rack#lib/rack/constants.rb:65
|
|
2589
|
+
Rack::RACK_REQUEST_QUERY_HASH = T.let(T.unsafe(nil), String)
|
|
2590
|
+
|
|
2591
|
+
# pkg:gem/rack#lib/rack/constants.rb:66
|
|
2592
|
+
Rack::RACK_REQUEST_QUERY_STRING = T.let(T.unsafe(nil), String)
|
|
2593
|
+
|
|
2594
|
+
# pkg:gem/rack#lib/rack/constants.rb:56
|
|
2595
|
+
Rack::RACK_RESPONSE_FINISHED = T.let(T.unsafe(nil), String)
|
|
2596
|
+
|
|
2597
|
+
# pkg:gem/rack#lib/rack/constants.rb:47
|
|
2598
|
+
Rack::RACK_SESSION = T.let(T.unsafe(nil), String)
|
|
2599
|
+
|
|
2600
|
+
# pkg:gem/rack#lib/rack/constants.rb:48
|
|
2601
|
+
Rack::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String)
|
|
2602
|
+
|
|
2603
|
+
# pkg:gem/rack#lib/rack/constants.rb:49
|
|
2604
|
+
Rack::RACK_SHOWSTATUS_DETAIL = T.let(T.unsafe(nil), String)
|
|
2605
|
+
|
|
2606
|
+
# pkg:gem/rack#lib/rack/constants.rb:42
|
|
2607
|
+
Rack::RACK_TEMPFILES = T.let(T.unsafe(nil), String)
|
|
2608
|
+
|
|
2609
|
+
# pkg:gem/rack#lib/rack/constants.rb:50
|
|
2610
|
+
Rack::RACK_URL_SCHEME = T.let(T.unsafe(nil), String)
|
|
2611
|
+
|
|
2612
|
+
# Rack environment variables
|
|
2613
|
+
#
|
|
2614
|
+
# pkg:gem/rack#lib/rack/constants.rb:41
|
|
2615
|
+
Rack::RACK_VERSION = T.let(T.unsafe(nil), String)
|
|
2616
|
+
|
|
2617
|
+
# pkg:gem/rack#lib/rack/version.rb:11
|
|
2618
|
+
Rack::RELEASE = T.let(T.unsafe(nil), String)
|
|
2619
|
+
|
|
2620
|
+
# pkg:gem/rack#lib/rack/constants.rb:9
|
|
2621
|
+
Rack::REQUEST_METHOD = T.let(T.unsafe(nil), String)
|
|
2622
|
+
|
|
2623
|
+
# pkg:gem/rack#lib/rack/constants.rb:10
|
|
2624
|
+
Rack::REQUEST_PATH = T.let(T.unsafe(nil), String)
|
|
2625
|
+
|
|
2626
|
+
# Rack::Recursive allows applications called down the chain to
|
|
2627
|
+
# include data from other applications (by using
|
|
2628
|
+
# <tt>rack['rack.recursive.include'][...]</tt> or raise a
|
|
2629
|
+
# ForwardRequest to redirect internally.
|
|
2630
|
+
#
|
|
2631
|
+
# pkg:gem/rack#lib/rack/recursive.rb:36
|
|
2632
|
+
class Rack::Recursive
|
|
2633
|
+
# pkg:gem/rack#lib/rack/recursive.rb:37
|
|
2634
|
+
def initialize(app); end
|
|
2635
|
+
|
|
2636
|
+
# pkg:gem/rack#lib/rack/recursive.rb:45
|
|
2637
|
+
def _call(env); end
|
|
2638
|
+
|
|
2639
|
+
# pkg:gem/rack#lib/rack/recursive.rb:41
|
|
2640
|
+
def call(env); end
|
|
2641
|
+
|
|
2642
|
+
# pkg:gem/rack#lib/rack/recursive.rb:52
|
|
2643
|
+
def include(env, path); end
|
|
2644
|
+
end
|
|
2645
|
+
|
|
2646
|
+
# High performant source reloader
|
|
2647
|
+
#
|
|
2648
|
+
# This class acts as Rack middleware.
|
|
2649
|
+
#
|
|
2650
|
+
# What makes it especially suited for use in a production environment is that
|
|
2651
|
+
# any file will only be checked once and there will only be made one system
|
|
2652
|
+
# call stat(2).
|
|
2653
|
+
#
|
|
2654
|
+
# Please note that this will not reload files in the background, it does so
|
|
2655
|
+
# only when actively called.
|
|
2656
|
+
#
|
|
2657
|
+
# It is performing a check/reload cycle at the start of every request, but
|
|
2658
|
+
# also respects a cool down time, during which nothing will be done.
|
|
2659
|
+
#
|
|
2660
|
+
# pkg:gem/rack#lib/rack/reloader.rb:24
|
|
2661
|
+
class Rack::Reloader
|
|
2662
|
+
# pkg:gem/rack#lib/rack/reloader.rb:25
|
|
2663
|
+
def initialize(app, cooldown = T.unsafe(nil), backend = T.unsafe(nil)); end
|
|
2664
|
+
|
|
2665
|
+
# pkg:gem/rack#lib/rack/reloader.rb:36
|
|
2666
|
+
def call(env); end
|
|
2667
|
+
|
|
2668
|
+
# pkg:gem/rack#lib/rack/reloader.rb:50
|
|
2669
|
+
def reload!(stderr = T.unsafe(nil)); end
|
|
2670
|
+
|
|
2671
|
+
# A safe Kernel::load, issuing the hooks depending on the results
|
|
2672
|
+
#
|
|
2673
|
+
# pkg:gem/rack#lib/rack/reloader.rb:58
|
|
2674
|
+
def safe_load(file, mtime, stderr = T.unsafe(nil)); end
|
|
2675
|
+
end
|
|
2676
|
+
|
|
2677
|
+
# pkg:gem/rack#lib/rack/reloader.rb:68
|
|
2678
|
+
module Rack::Reloader::Stat
|
|
2679
|
+
# Takes a relative or absolute +file+ name, a couple possible +paths+ that
|
|
2680
|
+
# the +file+ might reside in. Returns the full path and File::Stat for the
|
|
2681
|
+
# path.
|
|
2682
|
+
#
|
|
2683
|
+
# pkg:gem/rack#lib/rack/reloader.rb:88
|
|
2684
|
+
def figure_path(file, paths); end
|
|
2685
|
+
|
|
2686
|
+
# pkg:gem/rack#lib/rack/reloader.rb:69
|
|
2687
|
+
def rotation; end
|
|
2688
|
+
|
|
2689
|
+
# pkg:gem/rack#lib/rack/reloader.rb:103
|
|
2690
|
+
def safe_stat(file); end
|
|
2691
|
+
end
|
|
2692
|
+
|
|
2693
|
+
# Rack::Request provides a convenient interface to a Rack
|
|
2694
|
+
# environment. It is stateless, the environment +env+ passed to the
|
|
2695
|
+
# constructor will be directly modified.
|
|
2696
|
+
#
|
|
2697
|
+
# req = Rack::Request.new(env)
|
|
2698
|
+
# req.post?
|
|
2699
|
+
# req.params["data"]
|
|
2700
|
+
#
|
|
2701
|
+
# pkg:gem/rack#lib/rack/request.rb:16
|
|
2702
|
+
class Rack::Request
|
|
2703
|
+
include ::Rack::Request::Env
|
|
2704
|
+
include ::Rack::Request::Helpers
|
|
2705
|
+
|
|
2706
|
+
# pkg:gem/rack#lib/rack/request.rb:62
|
|
2707
|
+
def initialize(env); end
|
|
2708
|
+
|
|
2709
|
+
# pkg:gem/rack#lib/rack/request.rb:81
|
|
2710
|
+
def delete_param(k); end
|
|
2711
|
+
|
|
2712
|
+
# pkg:gem/rack#lib/rack/request.rb:68
|
|
2713
|
+
def ip; end
|
|
2714
|
+
|
|
2715
|
+
# pkg:gem/rack#lib/rack/request.rb:72
|
|
2716
|
+
def params; end
|
|
2717
|
+
|
|
2718
|
+
# pkg:gem/rack#lib/rack/request.rb:76
|
|
2719
|
+
def update_param(k, v); end
|
|
2720
|
+
|
|
2721
|
+
class << self
|
|
2722
|
+
# The priority when checking forwarded headers. The default
|
|
2723
|
+
# is <tt>[:forwarded, :x_forwarded]</tt>, which means, check the
|
|
2724
|
+
# +Forwarded+ header first, followed by the appropriate
|
|
2725
|
+
# <tt>X-Forwarded-*</tt> header. You can revert the priority by
|
|
2726
|
+
# reversing the priority, or remove checking of either
|
|
2727
|
+
# or both headers by removing elements from the array.
|
|
2728
|
+
#
|
|
2729
|
+
# This should be set as appropriate in your environment
|
|
2730
|
+
# based on what reverse proxies are in use. If you are not
|
|
2731
|
+
# using reverse proxies, you should probably use an empty
|
|
2732
|
+
# array.
|
|
2733
|
+
#
|
|
2734
|
+
# pkg:gem/rack#lib/rack/request.rb:31
|
|
2735
|
+
def forwarded_priority; end
|
|
2736
|
+
|
|
2737
|
+
# The priority when checking forwarded headers. The default
|
|
2738
|
+
# is <tt>[:forwarded, :x_forwarded]</tt>, which means, check the
|
|
2739
|
+
# +Forwarded+ header first, followed by the appropriate
|
|
2740
|
+
# <tt>X-Forwarded-*</tt> header. You can revert the priority by
|
|
2741
|
+
# reversing the priority, or remove checking of either
|
|
2742
|
+
# or both headers by removing elements from the array.
|
|
2743
|
+
#
|
|
2744
|
+
# This should be set as appropriate in your environment
|
|
2745
|
+
# based on what reverse proxies are in use. If you are not
|
|
2746
|
+
# using reverse proxies, you should probably use an empty
|
|
2747
|
+
# array.
|
|
2748
|
+
#
|
|
2749
|
+
# pkg:gem/rack#lib/rack/request.rb:31
|
|
2750
|
+
def forwarded_priority=(_arg0); end
|
|
2751
|
+
|
|
2752
|
+
# pkg:gem/rack#lib/rack/request.rb:18
|
|
2753
|
+
def ip_filter; end
|
|
2754
|
+
|
|
2755
|
+
# pkg:gem/rack#lib/rack/request.rb:18
|
|
2756
|
+
def ip_filter=(_arg0); end
|
|
2757
|
+
|
|
2758
|
+
# The priority when checking either the <tt>X-Forwarded-Proto</tt>
|
|
2759
|
+
# or <tt>X-Forwarded-Scheme</tt> header for the forwarded protocol.
|
|
2760
|
+
# The default is <tt>[:proto, :scheme]</tt>, to try the
|
|
2761
|
+
# <tt>X-Forwarded-Proto</tt> header before the
|
|
2762
|
+
# <tt>X-Forwarded-Scheme</tt> header. Rack 2 had behavior
|
|
2763
|
+
# similar to <tt>[:scheme, :proto]</tt>. You can remove either or
|
|
2764
|
+
# both of the entries in array to ignore that respective header.
|
|
2765
|
+
#
|
|
2766
|
+
# pkg:gem/rack#lib/rack/request.rb:40
|
|
2767
|
+
def x_forwarded_proto_priority; end
|
|
2768
|
+
|
|
2769
|
+
# The priority when checking either the <tt>X-Forwarded-Proto</tt>
|
|
2770
|
+
# or <tt>X-Forwarded-Scheme</tt> header for the forwarded protocol.
|
|
2771
|
+
# The default is <tt>[:proto, :scheme]</tt>, to try the
|
|
2772
|
+
# <tt>X-Forwarded-Proto</tt> header before the
|
|
2773
|
+
# <tt>X-Forwarded-Scheme</tt> header. Rack 2 had behavior
|
|
2774
|
+
# similar to <tt>[:scheme, :proto]</tt>. You can remove either or
|
|
2775
|
+
# both of the entries in array to ignore that respective header.
|
|
2776
|
+
#
|
|
2777
|
+
# pkg:gem/rack#lib/rack/request.rb:40
|
|
2778
|
+
def x_forwarded_proto_priority=(_arg0); end
|
|
2779
|
+
end
|
|
2780
|
+
end
|
|
2781
|
+
|
|
2782
|
+
# pkg:gem/rack#lib/rack/request.rb:60
|
|
2783
|
+
Rack::Request::ALLOWED_SCHEMES = T.let(T.unsafe(nil), Array)
|
|
2784
|
+
|
|
2785
|
+
# pkg:gem/rack#lib/rack/request.rb:87
|
|
2786
|
+
module Rack::Request::Env
|
|
2787
|
+
# pkg:gem/rack#lib/rack/request.rb:91
|
|
2788
|
+
def initialize(env); end
|
|
2789
|
+
|
|
2790
|
+
# Add a header that may have multiple values.
|
|
2791
|
+
#
|
|
2792
|
+
# Example:
|
|
2793
|
+
# request.add_header 'Accept', 'image/png'
|
|
2794
|
+
# request.add_header 'Accept', '*/*'
|
|
2795
|
+
#
|
|
2796
|
+
# assert_equal 'image/png,*/*', request.get_header('Accept')
|
|
2797
|
+
#
|
|
2798
|
+
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
|
|
2799
|
+
#
|
|
2800
|
+
# pkg:gem/rack#lib/rack/request.rb:134
|
|
2801
|
+
def add_header(key, v); end
|
|
2802
|
+
|
|
2803
|
+
# Delete a request specific value for `name`.
|
|
2804
|
+
#
|
|
2805
|
+
# pkg:gem/rack#lib/rack/request.rb:145
|
|
2806
|
+
def delete_header(name); end
|
|
2807
|
+
|
|
2808
|
+
# Loops through each key / value pair in the request specific data.
|
|
2809
|
+
#
|
|
2810
|
+
# pkg:gem/rack#lib/rack/request.rb:116
|
|
2811
|
+
def each_header(&block); end
|
|
2812
|
+
|
|
2813
|
+
# The environment of the request.
|
|
2814
|
+
#
|
|
2815
|
+
# pkg:gem/rack#lib/rack/request.rb:89
|
|
2816
|
+
def env; end
|
|
2817
|
+
|
|
2818
|
+
# If a block is given, it yields to the block if the value hasn't been set
|
|
2819
|
+
# on the request.
|
|
2820
|
+
#
|
|
2821
|
+
# pkg:gem/rack#lib/rack/request.rb:111
|
|
2822
|
+
def fetch_header(name, &block); end
|
|
2823
|
+
|
|
2824
|
+
# Get a request specific value for `name`.
|
|
2825
|
+
#
|
|
2826
|
+
# pkg:gem/rack#lib/rack/request.rb:105
|
|
2827
|
+
def get_header(name); end
|
|
2828
|
+
|
|
2829
|
+
# Predicate method to test to see if `name` has been set as request
|
|
2830
|
+
# specific data
|
|
2831
|
+
#
|
|
2832
|
+
# pkg:gem/rack#lib/rack/request.rb:100
|
|
2833
|
+
def has_header?(name); end
|
|
2834
|
+
|
|
2835
|
+
# Set a request specific value for `name` to `v`
|
|
2836
|
+
#
|
|
2837
|
+
# pkg:gem/rack#lib/rack/request.rb:121
|
|
2838
|
+
def set_header(name, v); end
|
|
2839
|
+
|
|
2840
|
+
private
|
|
2841
|
+
|
|
2842
|
+
# pkg:gem/rack#lib/rack/request.rb:149
|
|
2843
|
+
def initialize_copy(other); end
|
|
2844
|
+
end
|
|
2845
|
+
|
|
2846
|
+
# pkg:gem/rack#lib/rack/request.rb:154
|
|
2847
|
+
module Rack::Request::Helpers
|
|
2848
|
+
# Returns the data received in the query string.
|
|
2849
|
+
#
|
|
2850
|
+
# pkg:gem/rack#lib/rack/request.rb:491
|
|
2851
|
+
def GET; end
|
|
2852
|
+
|
|
2853
|
+
# Returns the data received in the request body.
|
|
2854
|
+
#
|
|
2855
|
+
# This method support both application/x-www-form-urlencoded and
|
|
2856
|
+
# multipart/form-data.
|
|
2857
|
+
#
|
|
2858
|
+
# pkg:gem/rack#lib/rack/request.rb:542
|
|
2859
|
+
def POST; end
|
|
2860
|
+
|
|
2861
|
+
# pkg:gem/rack#lib/rack/request.rb:611
|
|
2862
|
+
def accept_encoding; end
|
|
2863
|
+
|
|
2864
|
+
# pkg:gem/rack#lib/rack/request.rb:615
|
|
2865
|
+
def accept_language; end
|
|
2866
|
+
|
|
2867
|
+
# The authority of the incoming request as defined by RFC3976.
|
|
2868
|
+
# https://tools.ietf.org/html/rfc3986#section-3.2
|
|
2869
|
+
#
|
|
2870
|
+
# In HTTP/1, this is the `host` header.
|
|
2871
|
+
# In HTTP/2, this is the `:authority` pseudo-header.
|
|
2872
|
+
#
|
|
2873
|
+
# pkg:gem/rack#lib/rack/request.rb:271
|
|
2874
|
+
def authority; end
|
|
2875
|
+
|
|
2876
|
+
# pkg:gem/rack#lib/rack/request.rb:594
|
|
2877
|
+
def base_url; end
|
|
2878
|
+
|
|
2879
|
+
# pkg:gem/rack#lib/rack/request.rb:195
|
|
2880
|
+
def body; end
|
|
2881
|
+
|
|
2882
|
+
# The character set of the request body if a "charset" media type
|
|
2883
|
+
# parameter was given, or nil if no "charset" was specified. Note
|
|
2884
|
+
# that, per RFC2616, text/* media types that specify no explicit
|
|
2885
|
+
# charset are to be considered ISO-8859-1.
|
|
2886
|
+
#
|
|
2887
|
+
# pkg:gem/rack#lib/rack/request.rb:465
|
|
2888
|
+
def content_charset; end
|
|
2889
|
+
|
|
2890
|
+
# pkg:gem/rack#lib/rack/request.rb:204
|
|
2891
|
+
def content_length; end
|
|
2892
|
+
|
|
2893
|
+
# pkg:gem/rack#lib/rack/request.rb:313
|
|
2894
|
+
def content_type; end
|
|
2895
|
+
|
|
2896
|
+
# pkg:gem/rack#lib/rack/request.rb:298
|
|
2897
|
+
def cookies; end
|
|
2898
|
+
|
|
2899
|
+
# Checks the HTTP request method (or verb) to see if it was of type DELETE
|
|
2900
|
+
#
|
|
2901
|
+
# pkg:gem/rack#lib/rack/request.rb:225
|
|
2902
|
+
def delete?; end
|
|
2903
|
+
|
|
2904
|
+
# Destructively delete a parameter, whether it's in GET or POST. Returns the value of the deleted parameter.
|
|
2905
|
+
#
|
|
2906
|
+
# If the parameter is in both GET and POST, the POST value takes precedence since that's how #params works.
|
|
2907
|
+
#
|
|
2908
|
+
# <tt>env['rack.input']</tt> is not touched.
|
|
2909
|
+
#
|
|
2910
|
+
# pkg:gem/rack#lib/rack/request.rb:589
|
|
2911
|
+
def delete_param(k); end
|
|
2912
|
+
|
|
2913
|
+
# Determine whether the request body contains form-data by checking
|
|
2914
|
+
# the request content-type for one of the media-types:
|
|
2915
|
+
# "application/x-www-form-urlencoded" or "multipart/form-data". The
|
|
2916
|
+
# list of form-data media types can be modified through the
|
|
2917
|
+
# +FORM_DATA_MEDIA_TYPES+ array.
|
|
2918
|
+
#
|
|
2919
|
+
# A request body is also assumed to contain form-data when no
|
|
2920
|
+
# content-type header is provided and the request_method is POST.
|
|
2921
|
+
#
|
|
2922
|
+
# pkg:gem/rack#lib/rack/request.rb:477
|
|
2923
|
+
def form_data?; end
|
|
2924
|
+
|
|
2925
|
+
# Returns the form data pairs received in the request body.
|
|
2926
|
+
#
|
|
2927
|
+
# This method support both application/x-www-form-urlencoded and
|
|
2928
|
+
# multipart/form-data.
|
|
2929
|
+
#
|
|
2930
|
+
# pkg:gem/rack#lib/rack/request.rb:499
|
|
2931
|
+
def form_pairs; end
|
|
2932
|
+
|
|
2933
|
+
# pkg:gem/rack#lib/rack/request.rb:398
|
|
2934
|
+
def forwarded_authority; end
|
|
2935
|
+
|
|
2936
|
+
# pkg:gem/rack#lib/rack/request.rb:358
|
|
2937
|
+
def forwarded_for; end
|
|
2938
|
+
|
|
2939
|
+
# pkg:gem/rack#lib/rack/request.rb:379
|
|
2940
|
+
def forwarded_port; end
|
|
2941
|
+
|
|
2942
|
+
# pkg:gem/rack#lib/rack/request.rb:607
|
|
2943
|
+
def fullpath; end
|
|
2944
|
+
|
|
2945
|
+
# Checks the HTTP request method (or verb) to see if it was of type GET
|
|
2946
|
+
#
|
|
2947
|
+
# pkg:gem/rack#lib/rack/request.rb:228
|
|
2948
|
+
def get?; end
|
|
2949
|
+
|
|
2950
|
+
# Checks the HTTP request method (or verb) to see if it was of type HEAD
|
|
2951
|
+
#
|
|
2952
|
+
# pkg:gem/rack#lib/rack/request.rb:231
|
|
2953
|
+
def head?; end
|
|
2954
|
+
|
|
2955
|
+
# Returns a formatted host, suitable for being used in a URI.
|
|
2956
|
+
#
|
|
2957
|
+
# pkg:gem/rack#lib/rack/request.rb:338
|
|
2958
|
+
def host; end
|
|
2959
|
+
|
|
2960
|
+
# The `HTTP_HOST` header.
|
|
2961
|
+
#
|
|
2962
|
+
# pkg:gem/rack#lib/rack/request.rb:323
|
|
2963
|
+
def host_authority; end
|
|
2964
|
+
|
|
2965
|
+
# pkg:gem/rack#lib/rack/request.rb:327
|
|
2966
|
+
def host_with_port(authority = T.unsafe(nil)); end
|
|
2967
|
+
|
|
2968
|
+
# Returns an address suitable for being to resolve to an address.
|
|
2969
|
+
# In the case of a domain name or IPv4 address, the result is the same
|
|
2970
|
+
# as +host+. In the case of IPv6 or future address formats, the square
|
|
2971
|
+
# brackets are removed.
|
|
2972
|
+
#
|
|
2973
|
+
# pkg:gem/rack#lib/rack/request.rb:346
|
|
2974
|
+
def hostname; end
|
|
2975
|
+
|
|
2976
|
+
# pkg:gem/rack#lib/rack/request.rb:419
|
|
2977
|
+
def ip; end
|
|
2978
|
+
|
|
2979
|
+
# Checks the HTTP request method (or verb) to see if it was of type LINK
|
|
2980
|
+
#
|
|
2981
|
+
# pkg:gem/rack#lib/rack/request.rb:237
|
|
2982
|
+
def link?; end
|
|
2983
|
+
|
|
2984
|
+
# pkg:gem/rack#lib/rack/request.rb:205
|
|
2985
|
+
def logger; end
|
|
2986
|
+
|
|
2987
|
+
# The media type (type/subtype) portion of the CONTENT_TYPE header
|
|
2988
|
+
# without any media type parameters. e.g., when CONTENT_TYPE is
|
|
2989
|
+
# "text/plain;charset=utf-8", the media-type is "text/plain".
|
|
2990
|
+
#
|
|
2991
|
+
# For more information on the use of media types in HTTP, see:
|
|
2992
|
+
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
|
|
2993
|
+
#
|
|
2994
|
+
# pkg:gem/rack#lib/rack/request.rb:448
|
|
2995
|
+
def media_type; end
|
|
2996
|
+
|
|
2997
|
+
# The media type parameters provided in CONTENT_TYPE as a Hash, or
|
|
2998
|
+
# an empty Hash if no CONTENT_TYPE or media-type parameters were
|
|
2999
|
+
# provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8",
|
|
3000
|
+
# this method responds with the following Hash:
|
|
3001
|
+
# { 'charset' => 'utf-8' }
|
|
3002
|
+
#
|
|
3003
|
+
# pkg:gem/rack#lib/rack/request.rb:457
|
|
3004
|
+
def media_type_params; end
|
|
3005
|
+
|
|
3006
|
+
# Checks the HTTP request method (or verb) to see if it was of type OPTIONS
|
|
3007
|
+
#
|
|
3008
|
+
# pkg:gem/rack#lib/rack/request.rb:234
|
|
3009
|
+
def options?; end
|
|
3010
|
+
|
|
3011
|
+
# The union of GET and POST data.
|
|
3012
|
+
#
|
|
3013
|
+
# Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params.
|
|
3014
|
+
#
|
|
3015
|
+
# pkg:gem/rack#lib/rack/request.rb:556
|
|
3016
|
+
def params; end
|
|
3017
|
+
|
|
3018
|
+
# Determine whether the request body contains data by checking
|
|
3019
|
+
# the request media_type against registered parse-data media-types
|
|
3020
|
+
#
|
|
3021
|
+
# pkg:gem/rack#lib/rack/request.rb:486
|
|
3022
|
+
def parseable_data?; end
|
|
3023
|
+
|
|
3024
|
+
# Checks the HTTP request method (or verb) to see if it was of type PATCH
|
|
3025
|
+
#
|
|
3026
|
+
# pkg:gem/rack#lib/rack/request.rb:240
|
|
3027
|
+
def patch?; end
|
|
3028
|
+
|
|
3029
|
+
# pkg:gem/rack#lib/rack/request.rb:603
|
|
3030
|
+
def path; end
|
|
3031
|
+
|
|
3032
|
+
# pkg:gem/rack#lib/rack/request.rb:199
|
|
3033
|
+
def path_info; end
|
|
3034
|
+
|
|
3035
|
+
# pkg:gem/rack#lib/rack/request.rb:200
|
|
3036
|
+
def path_info=(s); end
|
|
3037
|
+
|
|
3038
|
+
# pkg:gem/rack#lib/rack/request.rb:350
|
|
3039
|
+
def port; end
|
|
3040
|
+
|
|
3041
|
+
# Checks the HTTP request method (or verb) to see if it was of type POST
|
|
3042
|
+
#
|
|
3043
|
+
# pkg:gem/rack#lib/rack/request.rb:243
|
|
3044
|
+
def post?; end
|
|
3045
|
+
|
|
3046
|
+
# Checks the HTTP request method (or verb) to see if it was of type PUT
|
|
3047
|
+
#
|
|
3048
|
+
# pkg:gem/rack#lib/rack/request.rb:246
|
|
3049
|
+
def put?; end
|
|
3050
|
+
|
|
3051
|
+
# Allow overriding the query parser that the receiver will use.
|
|
3052
|
+
# By default Rack::Utils.default_query_parser is used.
|
|
3053
|
+
#
|
|
3054
|
+
# pkg:gem/rack#lib/rack/request.rb:562
|
|
3055
|
+
def query_parser=(_arg0); end
|
|
3056
|
+
|
|
3057
|
+
# pkg:gem/rack#lib/rack/request.rb:203
|
|
3058
|
+
def query_string; end
|
|
3059
|
+
|
|
3060
|
+
# the referer of the client
|
|
3061
|
+
#
|
|
3062
|
+
# pkg:gem/rack#lib/rack/request.rb:209
|
|
3063
|
+
def referer; end
|
|
3064
|
+
|
|
3065
|
+
# pkg:gem/rack#lib/rack/request.rb:210
|
|
3066
|
+
def referrer; end
|
|
3067
|
+
|
|
3068
|
+
# pkg:gem/rack#lib/rack/request.rb:202
|
|
3069
|
+
def request_method; end
|
|
3070
|
+
|
|
3071
|
+
# pkg:gem/rack#lib/rack/request.rb:254
|
|
3072
|
+
def scheme; end
|
|
3073
|
+
|
|
3074
|
+
# pkg:gem/rack#lib/rack/request.rb:196
|
|
3075
|
+
def script_name; end
|
|
3076
|
+
|
|
3077
|
+
# pkg:gem/rack#lib/rack/request.rb:197
|
|
3078
|
+
def script_name=(s); end
|
|
3079
|
+
|
|
3080
|
+
# The authority as defined by the `SERVER_NAME` and `SERVER_PORT`
|
|
3081
|
+
# variables.
|
|
3082
|
+
#
|
|
3083
|
+
# pkg:gem/rack#lib/rack/request.rb:277
|
|
3084
|
+
def server_authority; end
|
|
3085
|
+
|
|
3086
|
+
# pkg:gem/rack#lib/rack/request.rb:290
|
|
3087
|
+
def server_name; end
|
|
3088
|
+
|
|
3089
|
+
# pkg:gem/rack#lib/rack/request.rb:294
|
|
3090
|
+
def server_port; end
|
|
3091
|
+
|
|
3092
|
+
# pkg:gem/rack#lib/rack/request.rb:212
|
|
3093
|
+
def session; end
|
|
3094
|
+
|
|
3095
|
+
# pkg:gem/rack#lib/rack/request.rb:218
|
|
3096
|
+
def session_options; end
|
|
3097
|
+
|
|
3098
|
+
# pkg:gem/rack#lib/rack/request.rb:415
|
|
3099
|
+
def ssl?; end
|
|
3100
|
+
|
|
3101
|
+
# Checks the HTTP request method (or verb) to see if it was of type TRACE
|
|
3102
|
+
#
|
|
3103
|
+
# pkg:gem/rack#lib/rack/request.rb:249
|
|
3104
|
+
def trace?; end
|
|
3105
|
+
|
|
3106
|
+
# pkg:gem/rack#lib/rack/request.rb:619
|
|
3107
|
+
def trusted_proxy?(ip); end
|
|
3108
|
+
|
|
3109
|
+
# Checks the HTTP request method (or verb) to see if it was of type UNLINK
|
|
3110
|
+
#
|
|
3111
|
+
# pkg:gem/rack#lib/rack/request.rb:252
|
|
3112
|
+
def unlink?; end
|
|
3113
|
+
|
|
3114
|
+
# Destructively update a parameter, whether it's in GET and/or POST. Returns nil.
|
|
3115
|
+
#
|
|
3116
|
+
# The parameter is updated wherever it was previous defined, so GET, POST, or both. If it wasn't previously defined, it's inserted into GET.
|
|
3117
|
+
#
|
|
3118
|
+
# <tt>env['rack.input']</tt> is not touched.
|
|
3119
|
+
#
|
|
3120
|
+
# pkg:gem/rack#lib/rack/request.rb:569
|
|
3121
|
+
def update_param(k, v); end
|
|
3122
|
+
|
|
3123
|
+
# Tries to return a remake of the original request URL as a string.
|
|
3124
|
+
#
|
|
3125
|
+
# pkg:gem/rack#lib/rack/request.rb:599
|
|
3126
|
+
def url; end
|
|
3127
|
+
|
|
3128
|
+
# pkg:gem/rack#lib/rack/request.rb:206
|
|
3129
|
+
def user_agent; end
|
|
3130
|
+
|
|
3131
|
+
# pkg:gem/rack#lib/rack/request.rb:318
|
|
3132
|
+
def xhr?; end
|
|
3133
|
+
|
|
3134
|
+
private
|
|
3135
|
+
|
|
3136
|
+
# pkg:gem/rack#lib/rack/request.rb:770
|
|
3137
|
+
def allowed_scheme(header); end
|
|
3138
|
+
|
|
3139
|
+
# pkg:gem/rack#lib/rack/request.rb:625
|
|
3140
|
+
def default_session; end
|
|
3141
|
+
|
|
3142
|
+
# pkg:gem/rack#lib/rack/request.rb:682
|
|
3143
|
+
def expand_param_pairs(pairs, query_parser = T.unsafe(nil)); end
|
|
3144
|
+
|
|
3145
|
+
# pkg:gem/rack#lib/rack/request.rb:774
|
|
3146
|
+
def forwarded_priority; end
|
|
3147
|
+
|
|
3148
|
+
# pkg:gem/rack#lib/rack/request.rb:746
|
|
3149
|
+
def forwarded_scheme; end
|
|
3150
|
+
|
|
3151
|
+
# Get an array of values set in the RFC 7239 `Forwarded` request header.
|
|
3152
|
+
#
|
|
3153
|
+
# pkg:gem/rack#lib/rack/request.rb:665
|
|
3154
|
+
def get_http_forwarded(token); end
|
|
3155
|
+
|
|
3156
|
+
# pkg:gem/rack#lib/rack/request.rb:641
|
|
3157
|
+
def parse_http_accept_header(header); end
|
|
3158
|
+
|
|
3159
|
+
# pkg:gem/rack#lib/rack/request.rb:677
|
|
3160
|
+
def parse_multipart; end
|
|
3161
|
+
|
|
3162
|
+
# pkg:gem/rack#lib/rack/request.rb:673
|
|
3163
|
+
def parse_query(qs, d = T.unsafe(nil)); end
|
|
3164
|
+
|
|
3165
|
+
# Allow overriding the query parser that the receiver will use.
|
|
3166
|
+
# By default Rack::Utils.default_query_parser is used.
|
|
3167
|
+
#
|
|
3168
|
+
# pkg:gem/rack#lib/rack/request.rb:669
|
|
3169
|
+
def query_parser; end
|
|
3170
|
+
|
|
3171
|
+
# pkg:gem/rack#lib/rack/request.rb:735
|
|
3172
|
+
def split_authority(authority); end
|
|
3173
|
+
|
|
3174
|
+
# pkg:gem/rack#lib/rack/request.rb:692
|
|
3175
|
+
def split_header(value); end
|
|
3176
|
+
|
|
3177
|
+
# Assist with compatibility when processing `X-Forwarded-For`.
|
|
3178
|
+
#
|
|
3179
|
+
# pkg:gem/rack#lib/rack/request.rb:628
|
|
3180
|
+
def wrap_ipv6(host); end
|
|
3181
|
+
|
|
3182
|
+
# pkg:gem/rack#lib/rack/request.rb:778
|
|
3183
|
+
def x_forwarded_proto_priority; end
|
|
3184
|
+
end
|
|
3185
|
+
|
|
3186
|
+
# pkg:gem/rack#lib/rack/request.rb:720
|
|
3187
|
+
Rack::Request::Helpers::AUTHORITY = T.let(T.unsafe(nil), Regexp)
|
|
3188
|
+
|
|
3189
|
+
# Default ports depending on scheme. Used to decide whether or not
|
|
3190
|
+
# to include the port in a generated URI.
|
|
3191
|
+
#
|
|
3192
|
+
# pkg:gem/rack#lib/rack/request.rb:173
|
|
3193
|
+
Rack::Request::Helpers::DEFAULT_PORTS = T.let(T.unsafe(nil), Hash)
|
|
3194
|
+
|
|
3195
|
+
# The set of form-data media-types. Requests that do not indicate
|
|
3196
|
+
# one of the media types present in this list will not be eligible
|
|
3197
|
+
# for form-data / param parsing.
|
|
3198
|
+
#
|
|
3199
|
+
# pkg:gem/rack#lib/rack/request.rb:158
|
|
3200
|
+
Rack::Request::Helpers::FORM_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array)
|
|
3201
|
+
|
|
3202
|
+
# pkg:gem/rack#lib/rack/request.rb:741
|
|
3203
|
+
Rack::Request::Helpers::FORWARDED_SCHEME_HEADERS = T.let(T.unsafe(nil), Hash)
|
|
3204
|
+
|
|
3205
|
+
# pkg:gem/rack#lib/rack/request.rb:181
|
|
3206
|
+
Rack::Request::Helpers::HTTP_FORWARDED = T.let(T.unsafe(nil), String)
|
|
3207
|
+
|
|
3208
|
+
# The address of the client which connected to the proxy.
|
|
3209
|
+
#
|
|
3210
|
+
# pkg:gem/rack#lib/rack/request.rb:176
|
|
3211
|
+
Rack::Request::Helpers::HTTP_X_FORWARDED_FOR = T.let(T.unsafe(nil), String)
|
|
3212
|
+
|
|
3213
|
+
# The contents of the host/:authority header sent to the proxy.
|
|
3214
|
+
#
|
|
3215
|
+
# pkg:gem/rack#lib/rack/request.rb:179
|
|
3216
|
+
Rack::Request::Helpers::HTTP_X_FORWARDED_HOST = T.let(T.unsafe(nil), String)
|
|
3217
|
+
|
|
3218
|
+
# The port used to connect to the proxy.
|
|
3219
|
+
#
|
|
3220
|
+
# pkg:gem/rack#lib/rack/request.rb:190
|
|
3221
|
+
Rack::Request::Helpers::HTTP_X_FORWARDED_PORT = T.let(T.unsafe(nil), String)
|
|
3222
|
+
|
|
3223
|
+
# The protocol used to connect to the proxy.
|
|
3224
|
+
#
|
|
3225
|
+
# pkg:gem/rack#lib/rack/request.rb:187
|
|
3226
|
+
Rack::Request::Helpers::HTTP_X_FORWARDED_PROTO = T.let(T.unsafe(nil), String)
|
|
3227
|
+
|
|
3228
|
+
# The value of the scheme sent to the proxy.
|
|
3229
|
+
#
|
|
3230
|
+
# pkg:gem/rack#lib/rack/request.rb:184
|
|
3231
|
+
Rack::Request::Helpers::HTTP_X_FORWARDED_SCHEME = T.let(T.unsafe(nil), String)
|
|
3232
|
+
|
|
3233
|
+
# Another way for specifying https scheme was used.
|
|
3234
|
+
#
|
|
3235
|
+
# pkg:gem/rack#lib/rack/request.rb:193
|
|
3236
|
+
Rack::Request::Helpers::HTTP_X_FORWARDED_SSL = T.let(T.unsafe(nil), String)
|
|
3237
|
+
|
|
3238
|
+
# The set of media-types. Requests that do not indicate
|
|
3239
|
+
# one of the media types present in this list will not be eligible
|
|
3240
|
+
# for param parsing like soap attachments or generic multiparts
|
|
3241
|
+
#
|
|
3242
|
+
# pkg:gem/rack#lib/rack/request.rb:166
|
|
3243
|
+
Rack::Request::Helpers::PARSEABLE_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array)
|
|
3244
|
+
|
|
3245
|
+
# Rack::Response provides a convenient interface to create a Rack
|
|
3246
|
+
# response.
|
|
3247
|
+
#
|
|
3248
|
+
# It allows setting of headers and cookies, and provides useful
|
|
3249
|
+
# defaults (an OK response with empty headers and body).
|
|
3250
|
+
#
|
|
3251
|
+
# You can use Response#write to iteratively generate your response,
|
|
3252
|
+
# but note that this is buffered by Rack::Response until you call
|
|
3253
|
+
# +finish+. +finish+ however can take a block inside which calls to
|
|
3254
|
+
# +write+ are synchronous with the Rack response.
|
|
3255
|
+
#
|
|
3256
|
+
# Your application's +call+ should end returning Response#finish.
|
|
3257
|
+
#
|
|
3258
|
+
# pkg:gem/rack#lib/rack/response.rb:23
|
|
3259
|
+
class Rack::Response
|
|
3260
|
+
include ::Rack::Response::Helpers
|
|
3261
|
+
|
|
3262
|
+
# Initialize the response object with the specified +body+, +status+
|
|
3263
|
+
# and +headers+.
|
|
3264
|
+
#
|
|
3265
|
+
# If the +body+ is +nil+, construct an empty response object with internal
|
|
3266
|
+
# buffering.
|
|
3267
|
+
#
|
|
3268
|
+
# If the +body+ responds to +to_str+, assume it's a string-like object and
|
|
3269
|
+
# construct a buffered response object containing using that string as the
|
|
3270
|
+
# initial contents of the buffer.
|
|
3271
|
+
#
|
|
3272
|
+
# Otherwise it is expected +body+ conforms to the normal requirements of a
|
|
3273
|
+
# Rack response body, typically implementing one of +each+ (enumerable
|
|
3274
|
+
# body) or +call+ (streaming body).
|
|
3275
|
+
#
|
|
3276
|
+
# The +status+ defaults to +200+ which is the "OK" HTTP status code. You
|
|
3277
|
+
# can provide any other valid status code.
|
|
3278
|
+
#
|
|
3279
|
+
# The +headers+ must be a +Hash+ of key-value header pairs which conform to
|
|
3280
|
+
# the Rack specification for response headers. The key must be a +String+
|
|
3281
|
+
# instance and the value can be either a +String+ or +Array+ instance.
|
|
3282
|
+
#
|
|
3283
|
+
# pkg:gem/rack#lib/rack/response.rb:54
|
|
3284
|
+
def initialize(body = T.unsafe(nil), status = T.unsafe(nil), headers = T.unsafe(nil)); end
|
|
3285
|
+
|
|
3286
|
+
# pkg:gem/rack#lib/rack/response.rb:177
|
|
3287
|
+
def [](key); end
|
|
3288
|
+
|
|
3289
|
+
# pkg:gem/rack#lib/rack/response.rb:178
|
|
3290
|
+
def []=(key, value); end
|
|
3291
|
+
|
|
3292
|
+
# pkg:gem/rack#lib/rack/response.rb:31
|
|
3293
|
+
def body; end
|
|
3294
|
+
|
|
3295
|
+
# pkg:gem/rack#lib/rack/response.rb:31
|
|
3296
|
+
def body=(_arg0); end
|
|
3297
|
+
|
|
3298
|
+
# pkg:gem/rack#lib/rack/response.rb:95
|
|
3299
|
+
def chunked?; end
|
|
3300
|
+
|
|
3301
|
+
# pkg:gem/rack#lib/rack/response.rb:152
|
|
3302
|
+
def close; end
|
|
3303
|
+
|
|
3304
|
+
# pkg:gem/rack#lib/rack/response.rb:172
|
|
3305
|
+
def delete_header(key); end
|
|
3306
|
+
|
|
3307
|
+
# For *response
|
|
3308
|
+
#
|
|
3309
|
+
# pkg:gem/rack#lib/rack/response.rb:130
|
|
3310
|
+
def each(&callback); end
|
|
3311
|
+
|
|
3312
|
+
# pkg:gem/rack#lib/rack/response.rb:156
|
|
3313
|
+
def empty?; end
|
|
3314
|
+
|
|
3315
|
+
# Generate a response array consistent with the requirements of the SPEC.
|
|
3316
|
+
# @return [Array] a 3-tuple suitable of `[status, headers, body]`
|
|
3317
|
+
# which is suitable to be returned from the middleware `#call(env)` method.
|
|
3318
|
+
#
|
|
3319
|
+
# pkg:gem/rack#lib/rack/response.rb:107
|
|
3320
|
+
def finish(&block); end
|
|
3321
|
+
|
|
3322
|
+
# pkg:gem/rack#lib/rack/response.rb:164
|
|
3323
|
+
def get_header(key); end
|
|
3324
|
+
|
|
3325
|
+
# pkg:gem/rack#lib/rack/response.rb:160
|
|
3326
|
+
def has_header?(key); end
|
|
3327
|
+
|
|
3328
|
+
# pkg:gem/rack#lib/rack/response.rb:32
|
|
3329
|
+
def headers; end
|
|
3330
|
+
|
|
3331
|
+
# pkg:gem/rack#lib/rack/response.rb:31
|
|
3332
|
+
def length; end
|
|
3333
|
+
|
|
3334
|
+
# pkg:gem/rack#lib/rack/response.rb:31
|
|
3335
|
+
def length=(_arg0); end
|
|
3336
|
+
|
|
3337
|
+
# pkg:gem/rack#lib/rack/response.rb:99
|
|
3338
|
+
def no_entity_body?; end
|
|
3339
|
+
|
|
3340
|
+
# pkg:gem/rack#lib/rack/response.rb:90
|
|
3341
|
+
def redirect(target, status = T.unsafe(nil)); end
|
|
3342
|
+
|
|
3343
|
+
# pkg:gem/rack#lib/rack/response.rb:168
|
|
3344
|
+
def set_header(key, value); end
|
|
3345
|
+
|
|
3346
|
+
# pkg:gem/rack#lib/rack/response.rb:31
|
|
3347
|
+
def status; end
|
|
3348
|
+
|
|
3349
|
+
# pkg:gem/rack#lib/rack/response.rb:31
|
|
3350
|
+
def status=(_arg0); end
|
|
3351
|
+
|
|
3352
|
+
# pkg:gem/rack#lib/rack/response.rb:128
|
|
3353
|
+
def to_a(&block); end
|
|
3354
|
+
|
|
3355
|
+
# Append a chunk to the response body.
|
|
3356
|
+
#
|
|
3357
|
+
# Converts the response into a buffered response if it wasn't already.
|
|
3358
|
+
#
|
|
3359
|
+
# NOTE: Do not mix #write and direct #body access!
|
|
3360
|
+
#
|
|
3361
|
+
# pkg:gem/rack#lib/rack/response.rb:146
|
|
3362
|
+
def write(chunk); end
|
|
3363
|
+
|
|
3364
|
+
class << self
|
|
3365
|
+
# pkg:gem/rack#lib/rack/response.rb:24
|
|
3366
|
+
def [](status, headers, body); end
|
|
3367
|
+
end
|
|
3368
|
+
end
|
|
3369
|
+
|
|
3370
|
+
# pkg:gem/rack#lib/rack/response.rb:28
|
|
3371
|
+
Rack::Response::CHUNKED = T.let(T.unsafe(nil), String)
|
|
3372
|
+
|
|
3373
|
+
# pkg:gem/rack#lib/rack/response.rb:180
|
|
3374
|
+
module Rack::Response::Helpers
|
|
3375
|
+
# pkg:gem/rack#lib/rack/response.rb:191
|
|
3376
|
+
def accepted?; end
|
|
3377
|
+
|
|
3378
|
+
# Add a header that may have multiple values.
|
|
3379
|
+
#
|
|
3380
|
+
# Example:
|
|
3381
|
+
# response.add_header 'vary', 'accept-encoding'
|
|
3382
|
+
# response.add_header 'vary', 'cookie'
|
|
3383
|
+
#
|
|
3384
|
+
# assert_equal 'accept-encoding,cookie', response.get_header('vary')
|
|
3385
|
+
#
|
|
3386
|
+
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
|
|
3387
|
+
#
|
|
3388
|
+
# pkg:gem/rack#lib/rack/response.rb:219
|
|
3389
|
+
def add_header(key, value); end
|
|
3390
|
+
|
|
3391
|
+
# pkg:gem/rack#lib/rack/response.rb:194
|
|
3392
|
+
def bad_request?; end
|
|
3393
|
+
|
|
3394
|
+
# Specify that the content should be cached.
|
|
3395
|
+
# @param duration [Integer] The number of seconds until the cache expires.
|
|
3396
|
+
# @option directive [String] The cache control directive, one of "public", "private", "no-cache" or "no-store".
|
|
3397
|
+
#
|
|
3398
|
+
# pkg:gem/rack#lib/rack/response.rb:307
|
|
3399
|
+
def cache!(duration = T.unsafe(nil), directive: T.unsafe(nil)); end
|
|
3400
|
+
|
|
3401
|
+
# pkg:gem/rack#lib/rack/response.rb:290
|
|
3402
|
+
def cache_control; end
|
|
3403
|
+
|
|
3404
|
+
# pkg:gem/rack#lib/rack/response.rb:294
|
|
3405
|
+
def cache_control=(value); end
|
|
3406
|
+
|
|
3407
|
+
# pkg:gem/rack#lib/rack/response.rb:186
|
|
3408
|
+
def client_error?; end
|
|
3409
|
+
|
|
3410
|
+
# pkg:gem/rack#lib/rack/response.rb:257
|
|
3411
|
+
def content_length; end
|
|
3412
|
+
|
|
3413
|
+
# Get the content type of the response.
|
|
3414
|
+
#
|
|
3415
|
+
# pkg:gem/rack#lib/rack/response.rb:240
|
|
3416
|
+
def content_type; end
|
|
3417
|
+
|
|
3418
|
+
# Set the content type of the response.
|
|
3419
|
+
#
|
|
3420
|
+
# pkg:gem/rack#lib/rack/response.rb:245
|
|
3421
|
+
def content_type=(content_type); end
|
|
3422
|
+
|
|
3423
|
+
# pkg:gem/rack#lib/rack/response.rb:190
|
|
3424
|
+
def created?; end
|
|
3425
|
+
|
|
3426
|
+
# pkg:gem/rack#lib/rack/response.rb:274
|
|
3427
|
+
def delete_cookie(key, value = T.unsafe(nil)); end
|
|
3428
|
+
|
|
3429
|
+
# Specifies that the content shouldn't be cached. Overrides `cache!` if already called.
|
|
3430
|
+
#
|
|
3431
|
+
# pkg:gem/rack#lib/rack/response.rb:299
|
|
3432
|
+
def do_not_cache!; end
|
|
3433
|
+
|
|
3434
|
+
# pkg:gem/rack#lib/rack/response.rb:314
|
|
3435
|
+
def etag; end
|
|
3436
|
+
|
|
3437
|
+
# pkg:gem/rack#lib/rack/response.rb:318
|
|
3438
|
+
def etag=(value); end
|
|
3439
|
+
|
|
3440
|
+
# pkg:gem/rack#lib/rack/response.rb:196
|
|
3441
|
+
def forbidden?; end
|
|
3442
|
+
|
|
3443
|
+
# pkg:gem/rack#lib/rack/response.rb:206
|
|
3444
|
+
def include?(header); end
|
|
3445
|
+
|
|
3446
|
+
# pkg:gem/rack#lib/rack/response.rb:183
|
|
3447
|
+
def informational?; end
|
|
3448
|
+
|
|
3449
|
+
# pkg:gem/rack#lib/rack/response.rb:181
|
|
3450
|
+
def invalid?; end
|
|
3451
|
+
|
|
3452
|
+
# pkg:gem/rack#lib/rack/response.rb:262
|
|
3453
|
+
def location; end
|
|
3454
|
+
|
|
3455
|
+
# pkg:gem/rack#lib/rack/response.rb:266
|
|
3456
|
+
def location=(location); end
|
|
3457
|
+
|
|
3458
|
+
# pkg:gem/rack#lib/rack/response.rb:249
|
|
3459
|
+
def media_type; end
|
|
3460
|
+
|
|
3461
|
+
# pkg:gem/rack#lib/rack/response.rb:253
|
|
3462
|
+
def media_type_params; end
|
|
3463
|
+
|
|
3464
|
+
# pkg:gem/rack#lib/rack/response.rb:198
|
|
3465
|
+
def method_not_allowed?; end
|
|
3466
|
+
|
|
3467
|
+
# pkg:gem/rack#lib/rack/response.rb:193
|
|
3468
|
+
def moved_permanently?; end
|
|
3469
|
+
|
|
3470
|
+
# pkg:gem/rack#lib/rack/response.rb:192
|
|
3471
|
+
def no_content?; end
|
|
3472
|
+
|
|
3473
|
+
# pkg:gem/rack#lib/rack/response.rb:199
|
|
3474
|
+
def not_acceptable?; end
|
|
3475
|
+
|
|
3476
|
+
# pkg:gem/rack#lib/rack/response.rb:197
|
|
3477
|
+
def not_found?; end
|
|
3478
|
+
|
|
3479
|
+
# pkg:gem/rack#lib/rack/response.rb:189
|
|
3480
|
+
def ok?; end
|
|
3481
|
+
|
|
3482
|
+
# pkg:gem/rack#lib/rack/response.rb:201
|
|
3483
|
+
def precondition_failed?; end
|
|
3484
|
+
|
|
3485
|
+
# pkg:gem/rack#lib/rack/response.rb:204
|
|
3486
|
+
def redirect?; end
|
|
3487
|
+
|
|
3488
|
+
# pkg:gem/rack#lib/rack/response.rb:185
|
|
3489
|
+
def redirection?; end
|
|
3490
|
+
|
|
3491
|
+
# pkg:gem/rack#lib/rack/response.rb:200
|
|
3492
|
+
def request_timeout?; end
|
|
3493
|
+
|
|
3494
|
+
# pkg:gem/rack#lib/rack/response.rb:187
|
|
3495
|
+
def server_error?; end
|
|
3496
|
+
|
|
3497
|
+
# pkg:gem/rack#lib/rack/response.rb:270
|
|
3498
|
+
def set_cookie(key, value); end
|
|
3499
|
+
|
|
3500
|
+
# pkg:gem/rack#lib/rack/response.rb:282
|
|
3501
|
+
def set_cookie_header; end
|
|
3502
|
+
|
|
3503
|
+
# pkg:gem/rack#lib/rack/response.rb:286
|
|
3504
|
+
def set_cookie_header=(value); end
|
|
3505
|
+
|
|
3506
|
+
# pkg:gem/rack#lib/rack/response.rb:184
|
|
3507
|
+
def successful?; end
|
|
3508
|
+
|
|
3509
|
+
# pkg:gem/rack#lib/rack/response.rb:195
|
|
3510
|
+
def unauthorized?; end
|
|
3511
|
+
|
|
3512
|
+
# pkg:gem/rack#lib/rack/response.rb:202
|
|
3513
|
+
def unprocessable?; end
|
|
3514
|
+
|
|
3515
|
+
protected
|
|
3516
|
+
|
|
3517
|
+
# pkg:gem/rack#lib/rack/response.rb:359
|
|
3518
|
+
def append(chunk); end
|
|
3519
|
+
|
|
3520
|
+
# Convert the body of this response into an internally buffered Array if possible.
|
|
3521
|
+
#
|
|
3522
|
+
# `@buffered` is a ternary value which indicates whether the body is buffered. It can be:
|
|
3523
|
+
# * `nil` - The body has not been buffered yet.
|
|
3524
|
+
# * `true` - The body is buffered as an Array instance.
|
|
3525
|
+
# * `false` - The body is not buffered and cannot be buffered.
|
|
3526
|
+
#
|
|
3527
|
+
# @return [Boolean] whether the body is buffered as an Array instance.
|
|
3528
|
+
#
|
|
3529
|
+
# pkg:gem/rack#lib/rack/response.rb:332
|
|
3530
|
+
def buffered_body!; end
|
|
3531
|
+
end
|
|
3532
|
+
|
|
3533
|
+
# pkg:gem/rack#lib/rack/response.rb:375
|
|
3534
|
+
class Rack::Response::Raw
|
|
3535
|
+
include ::Rack::Response::Helpers
|
|
3536
|
+
|
|
3537
|
+
# pkg:gem/rack#lib/rack/response.rb:381
|
|
3538
|
+
def initialize(status, headers); end
|
|
3539
|
+
|
|
3540
|
+
# pkg:gem/rack#lib/rack/response.rb:398
|
|
3541
|
+
def delete_header(key); end
|
|
3542
|
+
|
|
3543
|
+
# pkg:gem/rack#lib/rack/response.rb:390
|
|
3544
|
+
def get_header(key); end
|
|
3545
|
+
|
|
3546
|
+
# pkg:gem/rack#lib/rack/response.rb:386
|
|
3547
|
+
def has_header?(key); end
|
|
3548
|
+
|
|
3549
|
+
# pkg:gem/rack#lib/rack/response.rb:378
|
|
3550
|
+
def headers; end
|
|
3551
|
+
|
|
3552
|
+
# pkg:gem/rack#lib/rack/response.rb:394
|
|
3553
|
+
def set_header(key, value); end
|
|
3554
|
+
|
|
3555
|
+
# pkg:gem/rack#lib/rack/response.rb:379
|
|
3556
|
+
def status; end
|
|
3557
|
+
|
|
3558
|
+
# pkg:gem/rack#lib/rack/response.rb:379
|
|
3559
|
+
def status=(_arg0); end
|
|
3560
|
+
end
|
|
3561
|
+
|
|
3562
|
+
# pkg:gem/rack#lib/rack/response.rb:29
|
|
3563
|
+
Rack::Response::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash)
|
|
3564
|
+
|
|
3565
|
+
# Class which can make any IO object rewindable, including non-rewindable ones. It does
|
|
3566
|
+
# this by buffering the data into a tempfile, which is rewindable.
|
|
3567
|
+
#
|
|
3568
|
+
# Don't forget to call #close when you're done. This frees up temporary resources that
|
|
3569
|
+
# RewindableInput uses, though it does *not* close the original IO object.
|
|
3570
|
+
#
|
|
3571
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:14
|
|
3572
|
+
class Rack::RewindableInput
|
|
3573
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:32
|
|
3574
|
+
def initialize(io); end
|
|
3575
|
+
|
|
3576
|
+
# Closes this RewindableInput object without closing the originally
|
|
3577
|
+
# wrapped IO object. Cleans up any temporary resources that this RewindableInput
|
|
3578
|
+
# has created.
|
|
3579
|
+
#
|
|
3580
|
+
# This method may be called multiple times. It does nothing on subsequent calls.
|
|
3581
|
+
#
|
|
3582
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:68
|
|
3583
|
+
def close; end
|
|
3584
|
+
|
|
3585
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:48
|
|
3586
|
+
def each(&block); end
|
|
3587
|
+
|
|
3588
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:38
|
|
3589
|
+
def gets; end
|
|
3590
|
+
|
|
3591
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:43
|
|
3592
|
+
def read(*args); end
|
|
3593
|
+
|
|
3594
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:53
|
|
3595
|
+
def rewind; end
|
|
3596
|
+
|
|
3597
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:58
|
|
3598
|
+
def size; end
|
|
3599
|
+
|
|
3600
|
+
private
|
|
3601
|
+
|
|
3602
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:112
|
|
3603
|
+
def filesystem_has_posix_semantics?; end
|
|
3604
|
+
|
|
3605
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:81
|
|
3606
|
+
def make_rewindable; end
|
|
3607
|
+
end
|
|
3608
|
+
|
|
3609
|
+
# Makes rack.input rewindable, for compatibility with applications and middleware
|
|
3610
|
+
# designed for earlier versions of Rack (where rack.input was required to be
|
|
3611
|
+
# rewindable).
|
|
3612
|
+
#
|
|
3613
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:18
|
|
3614
|
+
class Rack::RewindableInput::Middleware
|
|
3615
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:19
|
|
3616
|
+
def initialize(app); end
|
|
3617
|
+
|
|
3618
|
+
# pkg:gem/rack#lib/rack/rewindable_input.rb:23
|
|
3619
|
+
def call(env); end
|
|
3620
|
+
end
|
|
3621
|
+
|
|
3622
|
+
# Sets an "x-runtime" response header, indicating the response
|
|
3623
|
+
# time of the request, in seconds
|
|
3624
|
+
#
|
|
3625
|
+
# You can put it right before the application to see the processing
|
|
3626
|
+
# time, or before all the other middlewares to include time for them,
|
|
3627
|
+
# too.
|
|
3628
|
+
#
|
|
3629
|
+
# pkg:gem/rack#lib/rack/runtime.rb:12
|
|
3630
|
+
class Rack::Runtime
|
|
3631
|
+
# pkg:gem/rack#lib/rack/runtime.rb:16
|
|
3632
|
+
def initialize(app, name = T.unsafe(nil)); end
|
|
3633
|
+
|
|
3634
|
+
# pkg:gem/rack#lib/rack/runtime.rb:22
|
|
3635
|
+
def call(env); end
|
|
3636
|
+
end
|
|
3637
|
+
|
|
3638
|
+
# pkg:gem/rack#lib/rack/runtime.rb:13
|
|
3639
|
+
Rack::Runtime::FORMAT_STRING = T.let(T.unsafe(nil), String)
|
|
3640
|
+
|
|
3641
|
+
# pkg:gem/rack#lib/rack/runtime.rb:14
|
|
3642
|
+
Rack::Runtime::HEADER_NAME = T.let(T.unsafe(nil), String)
|
|
3643
|
+
|
|
3644
|
+
# pkg:gem/rack#lib/rack/constants.rb:11
|
|
3645
|
+
Rack::SCRIPT_NAME = T.let(T.unsafe(nil), String)
|
|
3646
|
+
|
|
3647
|
+
# pkg:gem/rack#lib/rack/constants.rb:14
|
|
3648
|
+
Rack::SERVER_NAME = T.let(T.unsafe(nil), String)
|
|
3649
|
+
|
|
3650
|
+
# pkg:gem/rack#lib/rack/constants.rb:15
|
|
3651
|
+
Rack::SERVER_PORT = T.let(T.unsafe(nil), String)
|
|
3652
|
+
|
|
3653
|
+
# pkg:gem/rack#lib/rack/constants.rb:13
|
|
3654
|
+
Rack::SERVER_PROTOCOL = T.let(T.unsafe(nil), String)
|
|
3655
|
+
|
|
3656
|
+
# pkg:gem/rack#lib/rack/constants.rb:24
|
|
3657
|
+
Rack::SET_COOKIE = T.let(T.unsafe(nil), String)
|
|
3658
|
+
|
|
3659
|
+
# = Sendfile
|
|
3660
|
+
#
|
|
3661
|
+
# The Sendfile middleware intercepts responses whose body is being
|
|
3662
|
+
# served from a file and replaces it with a server specific x-sendfile
|
|
3663
|
+
# header. The web server is then responsible for writing the file contents
|
|
3664
|
+
# to the client. This can dramatically reduce the amount of work required
|
|
3665
|
+
# by the Ruby backend and takes advantage of the web server's optimized file
|
|
3666
|
+
# delivery code.
|
|
3667
|
+
#
|
|
3668
|
+
# In order to take advantage of this middleware, the response body must
|
|
3669
|
+
# respond to +to_path+ and the request must include an `x-sendfile-type`
|
|
3670
|
+
# header. Rack::Files and other components implement +to_path+ so there's
|
|
3671
|
+
# rarely anything you need to do in your application. The `x-sendfile-type`
|
|
3672
|
+
# header is typically set in your web servers configuration. The following
|
|
3673
|
+
# sections attempt to document
|
|
3674
|
+
#
|
|
3675
|
+
# === Nginx
|
|
3676
|
+
#
|
|
3677
|
+
# Nginx supports the `x-accel-redirect` header. This is similar to `x-sendfile`
|
|
3678
|
+
# but requires parts of the filesystem to be mapped into a private URL
|
|
3679
|
+
# hierarchy.
|
|
3680
|
+
#
|
|
3681
|
+
# The following example shows the Nginx configuration required to create
|
|
3682
|
+
# a private "/files/" area, enable `x-accel-redirect`, and pass the special
|
|
3683
|
+
# `x-accel-mapping` header to the backend:
|
|
3684
|
+
#
|
|
3685
|
+
# location ~ /files/(.*) {
|
|
3686
|
+
# internal;
|
|
3687
|
+
# alias /var/www/$1;
|
|
3688
|
+
# }
|
|
3689
|
+
#
|
|
3690
|
+
# location / {
|
|
3691
|
+
# proxy_redirect off;
|
|
3692
|
+
#
|
|
3693
|
+
# proxy_set_header Host $host;
|
|
3694
|
+
# proxy_set_header X-Real-IP $remote_addr;
|
|
3695
|
+
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
3696
|
+
#
|
|
3697
|
+
# proxy_set_header x-accel-mapping /var/www/=/files/;
|
|
3698
|
+
#
|
|
3699
|
+
# proxy_pass http://127.0.0.1:8080/;
|
|
3700
|
+
# }
|
|
3701
|
+
#
|
|
3702
|
+
# The `x-accel-mapping` header should specify the location on the file system,
|
|
3703
|
+
# followed by an equals sign (=), followed name of the private URL pattern
|
|
3704
|
+
# that it maps to. The middleware performs a case-insensitive substitution on the
|
|
3705
|
+
# resulting path.
|
|
3706
|
+
#
|
|
3707
|
+
# To enable `x-accel-redirect`, you must configure the middleware explicitly:
|
|
3708
|
+
#
|
|
3709
|
+
# use Rack::Sendfile, "x-accel-redirect"
|
|
3710
|
+
#
|
|
3711
|
+
# For security reasons, the `x-sendfile-type` header from requests is ignored.
|
|
3712
|
+
# The sendfile variation must be set via the middleware constructor.
|
|
3713
|
+
#
|
|
3714
|
+
# See Also: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile
|
|
3715
|
+
#
|
|
3716
|
+
# === lighttpd
|
|
3717
|
+
#
|
|
3718
|
+
# Lighttpd has supported some variation of the `x-sendfile` header for some
|
|
3719
|
+
# time, although only recent version support `x-sendfile` in a reverse proxy
|
|
3720
|
+
# configuration.
|
|
3721
|
+
#
|
|
3722
|
+
# $HTTP["host"] == "example.com" {
|
|
3723
|
+
# proxy-core.protocol = "http"
|
|
3724
|
+
# proxy-core.balancer = "round-robin"
|
|
3725
|
+
# proxy-core.backends = (
|
|
3726
|
+
# "127.0.0.1:8000",
|
|
3727
|
+
# "127.0.0.1:8001",
|
|
3728
|
+
# ...
|
|
3729
|
+
# )
|
|
3730
|
+
#
|
|
3731
|
+
# proxy-core.allow-x-sendfile = "enable"
|
|
3732
|
+
# proxy-core.rewrite-request = (
|
|
3733
|
+
# "x-sendfile-type" => (".*" => "x-sendfile")
|
|
3734
|
+
# )
|
|
3735
|
+
# }
|
|
3736
|
+
#
|
|
3737
|
+
# See Also: http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModProxyCore
|
|
3738
|
+
#
|
|
3739
|
+
# === Apache
|
|
3740
|
+
#
|
|
3741
|
+
# `x-sendfile` is supported under Apache 2.x using a separate module:
|
|
3742
|
+
#
|
|
3743
|
+
# https://tn123.org/mod_xsendfile/
|
|
3744
|
+
#
|
|
3745
|
+
# Once the module is compiled and installed, you can enable it using
|
|
3746
|
+
# XSendFile config directive:
|
|
3747
|
+
#
|
|
3748
|
+
# RequestHeader Set x-sendfile-type x-sendfile
|
|
3749
|
+
# ProxyPassReverse / http://localhost:8001/
|
|
3750
|
+
# XSendFile on
|
|
3751
|
+
#
|
|
3752
|
+
# === Mapping parameter
|
|
3753
|
+
#
|
|
3754
|
+
# The third parameter allows for an overriding extension of the
|
|
3755
|
+
# `x-accel-mapping` header. Mappings should be provided in tuples of internal to
|
|
3756
|
+
# external. The internal values may contain regular expression syntax, they
|
|
3757
|
+
# will be matched with case indifference.
|
|
3758
|
+
#
|
|
3759
|
+
# When `x-accel-redirect` is explicitly enabled via the variation parameter,
|
|
3760
|
+
# and no application-level mappings are provided, the middleware will read
|
|
3761
|
+
# the `x-accel-mapping` header from the proxy. This allows nginx to control
|
|
3762
|
+
# the path mapping without requiring application-level configuration.
|
|
3763
|
+
#
|
|
3764
|
+
# === Security
|
|
3765
|
+
#
|
|
3766
|
+
# For security reasons, the `x-sendfile-type` header from HTTP requests is
|
|
3767
|
+
# ignored. The sendfile variation must be explicitly configured via the
|
|
3768
|
+
# middleware constructor to prevent information disclosure vulnerabilities
|
|
3769
|
+
# where attackers could bypass proxy restrictions.
|
|
3770
|
+
#
|
|
3771
|
+
# pkg:gem/rack#lib/rack/sendfile.rb:121
|
|
3772
|
+
class Rack::Sendfile
|
|
3773
|
+
# pkg:gem/rack#lib/rack/sendfile.rb:122
|
|
3774
|
+
def initialize(app, variation = T.unsafe(nil), mappings = T.unsafe(nil)); end
|
|
3775
|
+
|
|
3776
|
+
# pkg:gem/rack#lib/rack/sendfile.rb:130
|
|
3777
|
+
def call(env); end
|
|
3778
|
+
|
|
3779
|
+
private
|
|
3780
|
+
|
|
3781
|
+
# pkg:gem/rack#lib/rack/sendfile.rb:182
|
|
3782
|
+
def map_accel_path(env, path); end
|
|
3783
|
+
|
|
3784
|
+
# pkg:gem/rack#lib/rack/sendfile.rb:166
|
|
3785
|
+
def variation(env); end
|
|
3786
|
+
|
|
3787
|
+
# pkg:gem/rack#lib/rack/sendfile.rb:172
|
|
3788
|
+
def x_accel_mapping(env); end
|
|
3789
|
+
end
|
|
3790
|
+
|
|
3791
|
+
# Rack::ShowExceptions catches all exceptions raised from the app it
|
|
3792
|
+
# wraps. It shows a useful backtrace with the sourcefile and
|
|
3793
|
+
# clickable context, the whole Rack environment and the request
|
|
3794
|
+
# data.
|
|
3795
|
+
#
|
|
3796
|
+
# Be careful when you use this on public-facing sites as it could
|
|
3797
|
+
# reveal information helpful to attackers.
|
|
3798
|
+
#
|
|
3799
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:18
|
|
3800
|
+
class Rack::ShowExceptions
|
|
3801
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:26
|
|
3802
|
+
def initialize(app); end
|
|
3803
|
+
|
|
3804
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:30
|
|
3805
|
+
def call(env); end
|
|
3806
|
+
|
|
3807
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:65
|
|
3808
|
+
def dump_exception(exception); end
|
|
3809
|
+
|
|
3810
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:120
|
|
3811
|
+
def h(obj); end
|
|
3812
|
+
|
|
3813
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:56
|
|
3814
|
+
def prefers_plaintext?(env); end
|
|
3815
|
+
|
|
3816
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:80
|
|
3817
|
+
def pretty(env, exception); end
|
|
3818
|
+
|
|
3819
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:116
|
|
3820
|
+
def template; end
|
|
3821
|
+
|
|
3822
|
+
private
|
|
3823
|
+
|
|
3824
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:60
|
|
3825
|
+
def accepts_html?(env); end
|
|
3826
|
+
end
|
|
3827
|
+
|
|
3828
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:19
|
|
3829
|
+
Rack::ShowExceptions::CONTEXT = T.let(T.unsafe(nil), Integer)
|
|
3830
|
+
|
|
3831
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3832
|
+
class Rack::ShowExceptions::Frame < ::Struct
|
|
3833
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3834
|
+
def context_line; end
|
|
3835
|
+
|
|
3836
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3837
|
+
def context_line=(_); end
|
|
3838
|
+
|
|
3839
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3840
|
+
def filename; end
|
|
3841
|
+
|
|
3842
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3843
|
+
def filename=(_); end
|
|
3844
|
+
|
|
3845
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3846
|
+
def function; end
|
|
3847
|
+
|
|
3848
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3849
|
+
def function=(_); end
|
|
3850
|
+
|
|
3851
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3852
|
+
def lineno; end
|
|
3853
|
+
|
|
3854
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3855
|
+
def lineno=(_); end
|
|
3856
|
+
|
|
3857
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3858
|
+
def post_context; end
|
|
3859
|
+
|
|
3860
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3861
|
+
def post_context=(_); end
|
|
3862
|
+
|
|
3863
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3864
|
+
def post_context_lineno; end
|
|
3865
|
+
|
|
3866
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3867
|
+
def post_context_lineno=(_); end
|
|
3868
|
+
|
|
3869
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3870
|
+
def pre_context; end
|
|
3871
|
+
|
|
3872
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3873
|
+
def pre_context=(_); end
|
|
3874
|
+
|
|
3875
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3876
|
+
def pre_context_lineno; end
|
|
3877
|
+
|
|
3878
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3879
|
+
def pre_context_lineno=(_); end
|
|
3880
|
+
|
|
3881
|
+
class << self
|
|
3882
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3883
|
+
def [](*_arg0); end
|
|
3884
|
+
|
|
3885
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3886
|
+
def inspect; end
|
|
3887
|
+
|
|
3888
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3889
|
+
def keyword_init?; end
|
|
3890
|
+
|
|
3891
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3892
|
+
def members; end
|
|
3893
|
+
|
|
3894
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:21
|
|
3895
|
+
def new(*_arg0); end
|
|
3896
|
+
end
|
|
3897
|
+
end
|
|
3898
|
+
|
|
3899
|
+
# adapted from Django <www.djangoproject.com>
|
|
3900
|
+
# Copyright (c) Django Software Foundation and individual contributors.
|
|
3901
|
+
# Used under the modified BSD license:
|
|
3902
|
+
# http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
|
|
3903
|
+
#
|
|
3904
|
+
# pkg:gem/rack#lib/rack/show_exceptions.rb:135
|
|
3905
|
+
Rack::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB)
|
|
3906
|
+
|
|
3907
|
+
# Rack::ShowStatus catches all empty responses and replaces them
|
|
3908
|
+
# with a site explaining the error.
|
|
3909
|
+
#
|
|
3910
|
+
# Additional details can be put into <tt>rack.showstatus.detail</tt>
|
|
3911
|
+
# and will be shown as HTML. If such details exist, the error page
|
|
3912
|
+
# is always rendered, even if the reply was not empty.
|
|
3913
|
+
#
|
|
3914
|
+
# pkg:gem/rack#lib/rack/show_status.rb:18
|
|
3915
|
+
class Rack::ShowStatus
|
|
3916
|
+
# pkg:gem/rack#lib/rack/show_status.rb:19
|
|
3917
|
+
def initialize(app); end
|
|
3918
|
+
|
|
3919
|
+
# pkg:gem/rack#lib/rack/show_status.rb:24
|
|
3920
|
+
def call(env); end
|
|
3921
|
+
|
|
3922
|
+
# pkg:gem/rack#lib/rack/show_status.rb:54
|
|
3923
|
+
def h(obj); end
|
|
3924
|
+
end
|
|
3925
|
+
|
|
3926
|
+
# adapted from Django <www.djangoproject.com>
|
|
3927
|
+
# Copyright (c) Django Software Foundation and individual contributors.
|
|
3928
|
+
# Used under the modified BSD license:
|
|
3929
|
+
# http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
|
|
3930
|
+
#
|
|
3931
|
+
# pkg:gem/rack#lib/rack/show_status.rb:69
|
|
3932
|
+
Rack::ShowStatus::TEMPLATE = T.let(T.unsafe(nil), String)
|
|
3933
|
+
|
|
3934
|
+
# The Rack::Static middleware intercepts requests for static files
|
|
3935
|
+
# (javascript files, images, stylesheets, etc) based on the url prefixes or
|
|
3936
|
+
# route mappings passed in the options, and serves them using a Rack::Files
|
|
3937
|
+
# object. This allows a Rack stack to serve both static and dynamic content.
|
|
3938
|
+
#
|
|
3939
|
+
# Examples:
|
|
3940
|
+
#
|
|
3941
|
+
# Serve all requests beginning with /media from the "media" folder located
|
|
3942
|
+
# in the current directory (ie media/*):
|
|
3943
|
+
#
|
|
3944
|
+
# use Rack::Static, :urls => ["/media"]
|
|
3945
|
+
#
|
|
3946
|
+
# Same as previous, but instead of returning 404 for missing files under
|
|
3947
|
+
# /media, call the next middleware:
|
|
3948
|
+
#
|
|
3949
|
+
# use Rack::Static, :urls => ["/media"], :cascade => true
|
|
3950
|
+
#
|
|
3951
|
+
# Serve all requests beginning with /css or /images from the folder "public"
|
|
3952
|
+
# in the current directory (ie public/css/* and public/images/*):
|
|
3953
|
+
#
|
|
3954
|
+
# use Rack::Static, :urls => ["/css", "/images"], :root => "public"
|
|
3955
|
+
#
|
|
3956
|
+
# Serve all requests to / with "index.html" from the folder "public" in the
|
|
3957
|
+
# current directory (ie public/index.html):
|
|
3958
|
+
#
|
|
3959
|
+
# use Rack::Static, :urls => {"/" => 'index.html'}, :root => 'public'
|
|
3960
|
+
#
|
|
3961
|
+
# Serve all requests normally from the folder "public" in the current
|
|
3962
|
+
# directory but uses index.html as default route for "/"
|
|
3963
|
+
#
|
|
3964
|
+
# use Rack::Static, :urls => [""], :root => 'public', :index =>
|
|
3965
|
+
# 'index.html'
|
|
3966
|
+
#
|
|
3967
|
+
# Set custom HTTP Headers for based on rules:
|
|
3968
|
+
#
|
|
3969
|
+
# use Rack::Static, :root => 'public',
|
|
3970
|
+
# :header_rules => [
|
|
3971
|
+
# [rule, {header_field => content, header_field => content}],
|
|
3972
|
+
# [rule, {header_field => content}]
|
|
3973
|
+
# ]
|
|
3974
|
+
#
|
|
3975
|
+
# Rules for selecting files:
|
|
3976
|
+
#
|
|
3977
|
+
# 1) All files
|
|
3978
|
+
# Provide the :all symbol
|
|
3979
|
+
# :all => Matches every file
|
|
3980
|
+
#
|
|
3981
|
+
# 2) Folders
|
|
3982
|
+
# Provide the folder path as a string
|
|
3983
|
+
# '/folder' or '/folder/subfolder' => Matches files in a certain folder
|
|
3984
|
+
#
|
|
3985
|
+
# 3) File Extensions
|
|
3986
|
+
# Provide the file extensions as an array
|
|
3987
|
+
# ['css', 'js'] or %w(css js) => Matches files ending in .css or .js
|
|
3988
|
+
#
|
|
3989
|
+
# 4) Regular Expressions / Regexp
|
|
3990
|
+
# Provide a regular expression
|
|
3991
|
+
# %r{\.(?:css|js)\z} => Matches files ending in .css or .js
|
|
3992
|
+
# /\.(?:eot|ttf|otf|woff2|woff|svg)\z/ => Matches files ending in
|
|
3993
|
+
# the most common web font formats (.eot, .ttf, .otf, .woff2, .woff, .svg)
|
|
3994
|
+
# Note: This Regexp is available as a shortcut, using the :fonts rule
|
|
3995
|
+
#
|
|
3996
|
+
# 5) Font Shortcut
|
|
3997
|
+
# Provide the :fonts symbol
|
|
3998
|
+
# :fonts => Uses the Regexp rule stated right above to match all common web font endings
|
|
3999
|
+
#
|
|
4000
|
+
# Rule Ordering:
|
|
4001
|
+
# Rules are applied in the order that they are provided.
|
|
4002
|
+
# List rather general rules above special ones.
|
|
4003
|
+
#
|
|
4004
|
+
# Complete example use case including HTTP header rules:
|
|
4005
|
+
#
|
|
4006
|
+
# use Rack::Static, :root => 'public',
|
|
4007
|
+
# :header_rules => [
|
|
4008
|
+
# # Cache all static files in public caches (e.g. Rack::Cache)
|
|
4009
|
+
# # as well as in the browser
|
|
4010
|
+
# [:all, {'cache-control' => 'public, max-age=31536000'}],
|
|
4011
|
+
#
|
|
4012
|
+
# # Provide web fonts with cross-origin access-control-headers
|
|
4013
|
+
# # Firefox requires this when serving assets using a Content Delivery Network
|
|
4014
|
+
# [:fonts, {'access-control-allow-origin' => '*'}]
|
|
4015
|
+
# ]
|
|
4016
|
+
#
|
|
4017
|
+
# pkg:gem/rack#lib/rack/static.rb:92
|
|
4018
|
+
class Rack::Static
|
|
4019
|
+
# pkg:gem/rack#lib/rack/static.rb:93
|
|
4020
|
+
def initialize(app, options = T.unsafe(nil)); end
|
|
4021
|
+
|
|
4022
|
+
# pkg:gem/rack#lib/rack/static.rb:112
|
|
4023
|
+
def add_index_root?(path); end
|
|
4024
|
+
|
|
4025
|
+
# Convert HTTP header rules to HTTP headers
|
|
4026
|
+
#
|
|
4027
|
+
# pkg:gem/rack#lib/rack/static.rb:170
|
|
4028
|
+
def applicable_rules(path); end
|
|
4029
|
+
|
|
4030
|
+
# pkg:gem/rack#lib/rack/static.rb:128
|
|
4031
|
+
def call(env); end
|
|
4032
|
+
|
|
4033
|
+
# pkg:gem/rack#lib/rack/static.rb:124
|
|
4034
|
+
def can_serve(path); end
|
|
4035
|
+
|
|
4036
|
+
# pkg:gem/rack#lib/rack/static.rb:116
|
|
4037
|
+
def overwrite_file_path(path); end
|
|
4038
|
+
|
|
4039
|
+
# pkg:gem/rack#lib/rack/static.rb:120
|
|
4040
|
+
def route_file(path); end
|
|
4041
|
+
end
|
|
4042
|
+
|
|
4043
|
+
# pkg:gem/rack#lib/rack/constants.rb:38
|
|
4044
|
+
Rack::TRACE = T.let(T.unsafe(nil), String)
|
|
4045
|
+
|
|
4046
|
+
# pkg:gem/rack#lib/rack/constants.rb:25
|
|
4047
|
+
Rack::TRANSFER_ENCODING = T.let(T.unsafe(nil), String)
|
|
4048
|
+
|
|
4049
|
+
# Middleware tracks and cleans Tempfiles created throughout a request (i.e. Rack::Multipart)
|
|
4050
|
+
# Ideas/strategy based on posts by Eric Wong and Charles Oliver Nutter
|
|
4051
|
+
# https://groups.google.com/forum/#!searchin/rack-devel/temp/rack-devel/brK8eh-MByw/sw61oJJCGRMJ
|
|
4052
|
+
#
|
|
4053
|
+
# pkg:gem/rack#lib/rack/tempfile_reaper.rb:11
|
|
4054
|
+
class Rack::TempfileReaper
|
|
4055
|
+
# pkg:gem/rack#lib/rack/tempfile_reaper.rb:12
|
|
4056
|
+
def initialize(app); end
|
|
4057
|
+
|
|
4058
|
+
# pkg:gem/rack#lib/rack/tempfile_reaper.rb:16
|
|
4059
|
+
def call(env); end
|
|
4060
|
+
end
|
|
4061
|
+
|
|
4062
|
+
# pkg:gem/rack#lib/rack/constants.rb:37
|
|
4063
|
+
Rack::UNLINK = T.let(T.unsafe(nil), String)
|
|
4064
|
+
|
|
4065
|
+
# Rack::URLMap takes a hash mapping urls or paths to apps, and
|
|
4066
|
+
# dispatches accordingly. Support for HTTP/1.1 host names exists if
|
|
4067
|
+
# the URLs start with <tt>http://</tt> or <tt>https://</tt>.
|
|
4068
|
+
#
|
|
4069
|
+
# URLMap modifies the SCRIPT_NAME and PATH_INFO such that the part
|
|
4070
|
+
# relevant for dispatch is in the SCRIPT_NAME, and the rest in the
|
|
4071
|
+
# PATH_INFO. This should be taken care of when you need to
|
|
4072
|
+
# reconstruct the URL in order to create links.
|
|
4073
|
+
#
|
|
4074
|
+
# URLMap dispatches in such a way that the longest paths are tried
|
|
4075
|
+
# first, since they are most specific.
|
|
4076
|
+
#
|
|
4077
|
+
# pkg:gem/rack#lib/rack/urlmap.rb:20
|
|
4078
|
+
class Rack::URLMap
|
|
4079
|
+
# pkg:gem/rack#lib/rack/urlmap.rb:21
|
|
4080
|
+
def initialize(map = T.unsafe(nil)); end
|
|
4081
|
+
|
|
4082
|
+
# pkg:gem/rack#lib/rack/urlmap.rb:48
|
|
4083
|
+
def call(env); end
|
|
4084
|
+
|
|
4085
|
+
# pkg:gem/rack#lib/rack/urlmap.rb:25
|
|
4086
|
+
def remap(map); end
|
|
4087
|
+
|
|
4088
|
+
private
|
|
4089
|
+
|
|
4090
|
+
# pkg:gem/rack#lib/rack/urlmap.rb:87
|
|
4091
|
+
def casecmp?(v1, v2); end
|
|
4092
|
+
end
|
|
4093
|
+
|
|
4094
|
+
# Rack::Utils contains a grab-bag of useful methods for writing web
|
|
4095
|
+
# applications adopted from all kinds of Ruby libraries.
|
|
4096
|
+
#
|
|
4097
|
+
# pkg:gem/rack#lib/rack/utils.rb:20
|
|
4098
|
+
module Rack::Utils
|
|
4099
|
+
private
|
|
4100
|
+
|
|
4101
|
+
# Return best accept value to use, based on the algorithm
|
|
4102
|
+
# in RFC 2616 Section 14. If there are multiple best
|
|
4103
|
+
# matches (same specificity and quality), the value returned
|
|
4104
|
+
# is arbitrary.
|
|
4105
|
+
#
|
|
4106
|
+
# pkg:gem/rack#lib/rack/utils.rb:227
|
|
4107
|
+
def best_q_match(q_value_header, available_mimes); end
|
|
4108
|
+
|
|
4109
|
+
# pkg:gem/rack#lib/rack/utils.rb:120
|
|
4110
|
+
def build_nested_query(value, prefix = T.unsafe(nil)); end
|
|
4111
|
+
|
|
4112
|
+
# pkg:gem/rack#lib/rack/utils.rb:110
|
|
4113
|
+
def build_query(params); end
|
|
4114
|
+
|
|
4115
|
+
# Parses the "Range:" header, if present, into an array of Range objects.
|
|
4116
|
+
# Returns nil if the header is missing or syntactically invalid.
|
|
4117
|
+
# Returns an empty array if none of the ranges are satisfiable.
|
|
4118
|
+
#
|
|
4119
|
+
# pkg:gem/rack#lib/rack/utils.rb:492
|
|
4120
|
+
def byte_ranges(env, size, max_ranges: T.unsafe(nil)); end
|
|
4121
|
+
|
|
4122
|
+
# pkg:gem/rack#lib/rack/utils.rb:692
|
|
4123
|
+
def clean_path_info(path_info); end
|
|
4124
|
+
|
|
4125
|
+
# :nocov:
|
|
4126
|
+
#
|
|
4127
|
+
# pkg:gem/rack#lib/rack/utils.rb:91
|
|
4128
|
+
def clock_time; end
|
|
4129
|
+
|
|
4130
|
+
# pkg:gem/rack#lib/rack/utils.rb:450
|
|
4131
|
+
def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end
|
|
4132
|
+
|
|
4133
|
+
# :call-seq:
|
|
4134
|
+
# delete_set_cookie_header(key, value = {}) -> encoded string
|
|
4135
|
+
#
|
|
4136
|
+
# Generate an encoded string based on the given +key+ and +value+ using
|
|
4137
|
+
# set_cookie_header for the purpose of causing the specified cookie to be
|
|
4138
|
+
# deleted. The +value+ may be an instance of +Hash+ and can include
|
|
4139
|
+
# attributes as outlined by set_cookie_header. The encoded cookie will have
|
|
4140
|
+
# a +max_age+ of 0 seconds, an +expires+ date in the past and an empty
|
|
4141
|
+
# +value+. When used with the +set-cookie+ header, it will cause the client
|
|
4142
|
+
# to *remove* any matching cookie.
|
|
4143
|
+
#
|
|
4144
|
+
# delete_set_cookie_header("myname")
|
|
4145
|
+
# # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
|
|
4146
|
+
#
|
|
4147
|
+
# pkg:gem/rack#lib/rack/utils.rb:446
|
|
4148
|
+
def delete_set_cookie_header(key, value = T.unsafe(nil)); end
|
|
4149
|
+
|
|
4150
|
+
# :call-seq:
|
|
4151
|
+
# delete_set_cookie_header!(header, key, value = {}) -> header value
|
|
4152
|
+
#
|
|
4153
|
+
# Set an expired cookie in the specified headers with the given cookie
|
|
4154
|
+
# +key+ and +value+ using delete_set_cookie_header. This causes
|
|
4155
|
+
# the client to immediately delete the specified cookie.
|
|
4156
|
+
#
|
|
4157
|
+
# delete_set_cookie_header!(nil, "mycookie")
|
|
4158
|
+
# # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
|
|
4159
|
+
#
|
|
4160
|
+
# If the header is non-nil, it will be modified in place.
|
|
4161
|
+
#
|
|
4162
|
+
# header = []
|
|
4163
|
+
# delete_set_cookie_header!(header, "mycookie")
|
|
4164
|
+
# # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
|
|
4165
|
+
# header
|
|
4166
|
+
# # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
|
|
4167
|
+
#
|
|
4168
|
+
# pkg:gem/rack#lib/rack/utils.rb:474
|
|
4169
|
+
def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end
|
|
4170
|
+
|
|
4171
|
+
# URI escapes. (CGI style space to +)
|
|
4172
|
+
#
|
|
4173
|
+
# pkg:gem/rack#lib/rack/utils.rb:40
|
|
4174
|
+
def escape(s); end
|
|
4175
|
+
|
|
4176
|
+
# Escape ampersands, brackets and quotes to their HTML/XML entities.
|
|
4177
|
+
#
|
|
4178
|
+
# pkg:gem/rack#lib/rack/utils.rb:243
|
|
4179
|
+
def escape_html(_arg0); end
|
|
4180
|
+
|
|
4181
|
+
# Like URI escaping, but with %20 instead of +. Strictly speaking this is
|
|
4182
|
+
# true URI escaping.
|
|
4183
|
+
#
|
|
4184
|
+
# pkg:gem/rack#lib/rack/utils.rb:46
|
|
4185
|
+
def escape_path(s); end
|
|
4186
|
+
|
|
4187
|
+
# pkg:gem/rack#lib/rack/utils.rb:152
|
|
4188
|
+
def forwarded_values(forwarded_header); end
|
|
4189
|
+
|
|
4190
|
+
# pkg:gem/rack#lib/rack/utils.rb:496
|
|
4191
|
+
def get_byte_ranges(http_range, size, max_ranges: T.unsafe(nil)); end
|
|
4192
|
+
|
|
4193
|
+
# :call-seq:
|
|
4194
|
+
# parse_cookies(env) -> hash
|
|
4195
|
+
#
|
|
4196
|
+
# Parse cookies from the provided request environment using
|
|
4197
|
+
# parse_cookies_header. Returns a map of cookie +key+ to cookie +value+.
|
|
4198
|
+
#
|
|
4199
|
+
# parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'})
|
|
4200
|
+
# # => {'myname' => 'myvalue'}
|
|
4201
|
+
#
|
|
4202
|
+
# pkg:gem/rack#lib/rack/utils.rb:347
|
|
4203
|
+
def parse_cookies(env); end
|
|
4204
|
+
|
|
4205
|
+
# :call-seq:
|
|
4206
|
+
# parse_cookies_header(value) -> hash
|
|
4207
|
+
#
|
|
4208
|
+
# Parse cookies from the provided header +value+ according to RFC6265. The
|
|
4209
|
+
# syntax for cookie headers only supports semicolons. Returns a map of
|
|
4210
|
+
# cookie +key+ to cookie +value+.
|
|
4211
|
+
#
|
|
4212
|
+
# parse_cookies_header('myname=myvalue; max-age=0')
|
|
4213
|
+
# # => {"myname"=>"myvalue", "max-age"=>"0"}
|
|
4214
|
+
#
|
|
4215
|
+
# pkg:gem/rack#lib/rack/utils.rb:328
|
|
4216
|
+
def parse_cookies_header(value); end
|
|
4217
|
+
|
|
4218
|
+
# pkg:gem/rack#lib/rack/utils.rb:106
|
|
4219
|
+
def parse_nested_query(qs, d = T.unsafe(nil)); end
|
|
4220
|
+
|
|
4221
|
+
# pkg:gem/rack#lib/rack/utils.rb:102
|
|
4222
|
+
def parse_query(qs, d = T.unsafe(nil), &unescaper); end
|
|
4223
|
+
|
|
4224
|
+
# pkg:gem/rack#lib/rack/utils.rb:138
|
|
4225
|
+
def q_values(q_value_header); end
|
|
4226
|
+
|
|
4227
|
+
# pkg:gem/rack#lib/rack/utils.rb:485
|
|
4228
|
+
def rfc2822(time); end
|
|
4229
|
+
|
|
4230
|
+
# Constant time string comparison.
|
|
4231
|
+
#
|
|
4232
|
+
# NOTE: the values compared should be of fixed length, such as strings
|
|
4233
|
+
# that have already been processed by HMAC. This should not be used
|
|
4234
|
+
# on variable length plaintext strings because it could leak length info
|
|
4235
|
+
# via timing attacks.
|
|
4236
|
+
#
|
|
4237
|
+
# pkg:gem/rack#lib/rack/utils.rb:540
|
|
4238
|
+
def secure_compare(a, b); end
|
|
4239
|
+
|
|
4240
|
+
# Given an array of available encoding strings, and an array of
|
|
4241
|
+
# acceptable encodings for a request, where each element of the
|
|
4242
|
+
# acceptable encodings array is an array where the first element
|
|
4243
|
+
# is an encoding name and the second element is the numeric
|
|
4244
|
+
# priority for the encoding, return the available encoding with
|
|
4245
|
+
# the highest priority.
|
|
4246
|
+
#
|
|
4247
|
+
# The accept_encoding argument is typically generated by calling
|
|
4248
|
+
# Request#accept_encoding.
|
|
4249
|
+
#
|
|
4250
|
+
# Example:
|
|
4251
|
+
#
|
|
4252
|
+
# select_best_encoding(%w(compress gzip identity),
|
|
4253
|
+
# [["compress", 0.5], ["gzip", 1.0]])
|
|
4254
|
+
# # => "gzip"
|
|
4255
|
+
#
|
|
4256
|
+
# To reduce denial of service potential, only the first 16
|
|
4257
|
+
# acceptable encodings are considered.
|
|
4258
|
+
#
|
|
4259
|
+
# pkg:gem/rack#lib/rack/utils.rb:274
|
|
4260
|
+
def select_best_encoding(available_encodings, accept_encoding); end
|
|
4261
|
+
|
|
4262
|
+
# :call-seq:
|
|
4263
|
+
# set_cookie_header(key, value) -> encoded string
|
|
4264
|
+
#
|
|
4265
|
+
# Generate an encoded string using the provided +key+ and +value+ suitable
|
|
4266
|
+
# for the +set-cookie+ header according to RFC6265. The +value+ may be an
|
|
4267
|
+
# instance of either +String+ or +Hash+. If the cookie key is invalid (as
|
|
4268
|
+
# defined by RFC6265), an +ArgumentError+ will be raised.
|
|
4269
|
+
#
|
|
4270
|
+
# If the cookie +value+ is an instance of +Hash+, it considers the following
|
|
4271
|
+
# cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance
|
|
4272
|
+
# of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more
|
|
4273
|
+
# details about the interpretation of these fields, consult
|
|
4274
|
+
# [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2).
|
|
4275
|
+
#
|
|
4276
|
+
# set_cookie_header("myname", "myvalue")
|
|
4277
|
+
# # => "myname=myvalue"
|
|
4278
|
+
#
|
|
4279
|
+
# set_cookie_header("myname", {value: "myvalue", max_age: 10})
|
|
4280
|
+
# # => "myname=myvalue; max-age=10"
|
|
4281
|
+
#
|
|
4282
|
+
# pkg:gem/rack#lib/rack/utils.rb:376
|
|
4283
|
+
def set_cookie_header(key, value); end
|
|
4284
|
+
|
|
4285
|
+
# :call-seq:
|
|
4286
|
+
# set_cookie_header!(headers, key, value) -> header value
|
|
4287
|
+
#
|
|
4288
|
+
# Append a cookie in the specified headers with the given cookie +key+ and
|
|
4289
|
+
# +value+ using set_cookie_header.
|
|
4290
|
+
#
|
|
4291
|
+
# If the headers already contains a +set-cookie+ key, it will be converted
|
|
4292
|
+
# to an +Array+ if not already, and appended to.
|
|
4293
|
+
#
|
|
4294
|
+
# pkg:gem/rack#lib/rack/utils.rb:420
|
|
4295
|
+
def set_cookie_header!(headers, key, value); end
|
|
4296
|
+
|
|
4297
|
+
# pkg:gem/rack#lib/rack/utils.rb:674
|
|
4298
|
+
def status_code(status); end
|
|
4299
|
+
|
|
4300
|
+
# Unescapes a URI escaped string with +encoding+. +encoding+ will be the
|
|
4301
|
+
# target encoding of the string returned, and it defaults to UTF-8
|
|
4302
|
+
#
|
|
4303
|
+
# pkg:gem/rack#lib/rack/utils.rb:58
|
|
4304
|
+
def unescape(s, encoding = T.unsafe(nil)); end
|
|
4305
|
+
|
|
4306
|
+
# Unescapes the **path** component of a URI. See Rack::Utils.unescape for
|
|
4307
|
+
# unescaping query parameters or form components.
|
|
4308
|
+
#
|
|
4309
|
+
# pkg:gem/rack#lib/rack/utils.rb:52
|
|
4310
|
+
def unescape_path(s); end
|
|
4311
|
+
|
|
4312
|
+
# pkg:gem/rack#lib/rack/utils.rb:709
|
|
4313
|
+
def valid_path?(path); end
|
|
4314
|
+
|
|
4315
|
+
class << self
|
|
4316
|
+
# Return best accept value to use, based on the algorithm
|
|
4317
|
+
# in RFC 2616 Section 14. If there are multiple best
|
|
4318
|
+
# matches (same specificity and quality), the value returned
|
|
4319
|
+
# is arbitrary.
|
|
4320
|
+
#
|
|
4321
|
+
# pkg:gem/rack#lib/rack/utils.rb:227
|
|
4322
|
+
def best_q_match(q_value_header, available_mimes); end
|
|
4323
|
+
|
|
4324
|
+
# pkg:gem/rack#lib/rack/utils.rb:120
|
|
4325
|
+
def build_nested_query(value, prefix = T.unsafe(nil)); end
|
|
4326
|
+
|
|
4327
|
+
# pkg:gem/rack#lib/rack/utils.rb:110
|
|
4328
|
+
def build_query(params); end
|
|
4329
|
+
|
|
4330
|
+
# Parses the "Range:" header, if present, into an array of Range objects.
|
|
4331
|
+
# Returns nil if the header is missing or syntactically invalid.
|
|
4332
|
+
# Returns an empty array if none of the ranges are satisfiable.
|
|
4333
|
+
#
|
|
4334
|
+
# pkg:gem/rack#lib/rack/utils.rb:492
|
|
4335
|
+
def byte_ranges(env, size, max_ranges: T.unsafe(nil)); end
|
|
4336
|
+
|
|
4337
|
+
# pkg:gem/rack#lib/rack/utils.rb:692
|
|
4338
|
+
def clean_path_info(path_info); end
|
|
4339
|
+
|
|
4340
|
+
# :nocov:
|
|
4341
|
+
#
|
|
4342
|
+
# pkg:gem/rack#lib/rack/utils.rb:91
|
|
4343
|
+
def clock_time; end
|
|
4344
|
+
|
|
4345
|
+
# pkg:gem/rack#lib/rack/utils.rb:30
|
|
4346
|
+
def default_query_parser; end
|
|
4347
|
+
|
|
4348
|
+
# pkg:gem/rack#lib/rack/utils.rb:30
|
|
4349
|
+
def default_query_parser=(_arg0); end
|
|
4350
|
+
|
|
4351
|
+
# pkg:gem/rack#lib/rack/utils.rb:450
|
|
4352
|
+
def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end
|
|
4353
|
+
|
|
4354
|
+
# :call-seq:
|
|
4355
|
+
# delete_set_cookie_header(key, value = {}) -> encoded string
|
|
4356
|
+
#
|
|
4357
|
+
# Generate an encoded string based on the given +key+ and +value+ using
|
|
4358
|
+
# set_cookie_header for the purpose of causing the specified cookie to be
|
|
4359
|
+
# deleted. The +value+ may be an instance of +Hash+ and can include
|
|
4360
|
+
# attributes as outlined by set_cookie_header. The encoded cookie will have
|
|
4361
|
+
# a +max_age+ of 0 seconds, an +expires+ date in the past and an empty
|
|
4362
|
+
# +value+. When used with the +set-cookie+ header, it will cause the client
|
|
4363
|
+
# to *remove* any matching cookie.
|
|
4364
|
+
#
|
|
4365
|
+
# delete_set_cookie_header("myname")
|
|
4366
|
+
# # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
|
|
4367
|
+
#
|
|
4368
|
+
# pkg:gem/rack#lib/rack/utils.rb:446
|
|
4369
|
+
def delete_set_cookie_header(key, value = T.unsafe(nil)); end
|
|
4370
|
+
|
|
4371
|
+
# :call-seq:
|
|
4372
|
+
# delete_set_cookie_header!(header, key, value = {}) -> header value
|
|
4373
|
+
#
|
|
4374
|
+
# Set an expired cookie in the specified headers with the given cookie
|
|
4375
|
+
# +key+ and +value+ using delete_set_cookie_header. This causes
|
|
4376
|
+
# the client to immediately delete the specified cookie.
|
|
4377
|
+
#
|
|
4378
|
+
# delete_set_cookie_header!(nil, "mycookie")
|
|
4379
|
+
# # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
|
|
4380
|
+
#
|
|
4381
|
+
# If the header is non-nil, it will be modified in place.
|
|
4382
|
+
#
|
|
4383
|
+
# header = []
|
|
4384
|
+
# delete_set_cookie_header!(header, "mycookie")
|
|
4385
|
+
# # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
|
|
4386
|
+
# header
|
|
4387
|
+
# # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
|
|
4388
|
+
#
|
|
4389
|
+
# pkg:gem/rack#lib/rack/utils.rb:474
|
|
4390
|
+
def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end
|
|
4391
|
+
|
|
4392
|
+
# URI escapes. (CGI style space to +)
|
|
4393
|
+
#
|
|
4394
|
+
# pkg:gem/rack#lib/rack/utils.rb:40
|
|
4395
|
+
def escape(s); end
|
|
4396
|
+
|
|
4397
|
+
# Escape ampersands, brackets and quotes to their HTML/XML entities.
|
|
4398
|
+
#
|
|
4399
|
+
# pkg:gem/rack#lib/rack/utils.rb:243
|
|
4400
|
+
def escape_html(_arg0); end
|
|
4401
|
+
|
|
4402
|
+
# Like URI escaping, but with %20 instead of +. Strictly speaking this is
|
|
4403
|
+
# true URI escaping.
|
|
4404
|
+
#
|
|
4405
|
+
# pkg:gem/rack#lib/rack/utils.rb:46
|
|
4406
|
+
def escape_path(s); end
|
|
4407
|
+
|
|
4408
|
+
# pkg:gem/rack#lib/rack/utils.rb:152
|
|
4409
|
+
def forwarded_values(forwarded_header); end
|
|
4410
|
+
|
|
4411
|
+
# pkg:gem/rack#lib/rack/utils.rb:496
|
|
4412
|
+
def get_byte_ranges(http_range, size, max_ranges: T.unsafe(nil)); end
|
|
4413
|
+
|
|
4414
|
+
# pkg:gem/rack#lib/rack/utils.rb:65
|
|
4415
|
+
def multipart_file_limit; end
|
|
4416
|
+
|
|
4417
|
+
# pkg:gem/rack#lib/rack/utils.rb:65
|
|
4418
|
+
def multipart_file_limit=(_arg0); end
|
|
4419
|
+
|
|
4420
|
+
# multipart_part_limit is the original name of multipart_file_limit, but
|
|
4421
|
+
# the limit only counts parts with filenames.
|
|
4422
|
+
#
|
|
4423
|
+
# pkg:gem/rack#lib/rack/utils.rb:69
|
|
4424
|
+
def multipart_part_limit; end
|
|
4425
|
+
|
|
4426
|
+
# pkg:gem/rack#lib/rack/utils.rb:70
|
|
4427
|
+
def multipart_part_limit=(_arg0); end
|
|
4428
|
+
|
|
4429
|
+
# pkg:gem/rack#lib/rack/utils.rb:63
|
|
4430
|
+
def multipart_total_part_limit; end
|
|
4431
|
+
|
|
4432
|
+
# pkg:gem/rack#lib/rack/utils.rb:63
|
|
4433
|
+
def multipart_total_part_limit=(_arg0); end
|
|
4434
|
+
|
|
4435
|
+
# pkg:gem/rack#lib/rack/utils.rb:82
|
|
4436
|
+
def param_depth_limit; end
|
|
4437
|
+
|
|
4438
|
+
# pkg:gem/rack#lib/rack/utils.rb:86
|
|
4439
|
+
def param_depth_limit=(v); end
|
|
4440
|
+
|
|
4441
|
+
# :call-seq:
|
|
4442
|
+
# parse_cookies(env) -> hash
|
|
4443
|
+
#
|
|
4444
|
+
# Parse cookies from the provided request environment using
|
|
4445
|
+
# parse_cookies_header. Returns a map of cookie +key+ to cookie +value+.
|
|
4446
|
+
#
|
|
4447
|
+
# parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'})
|
|
4448
|
+
# # => {'myname' => 'myvalue'}
|
|
4449
|
+
#
|
|
4450
|
+
# pkg:gem/rack#lib/rack/utils.rb:347
|
|
4451
|
+
def parse_cookies(env); end
|
|
4452
|
+
|
|
4453
|
+
# :call-seq:
|
|
4454
|
+
# parse_cookies_header(value) -> hash
|
|
4455
|
+
#
|
|
4456
|
+
# Parse cookies from the provided header +value+ according to RFC6265. The
|
|
4457
|
+
# syntax for cookie headers only supports semicolons. Returns a map of
|
|
4458
|
+
# cookie +key+ to cookie +value+.
|
|
4459
|
+
#
|
|
4460
|
+
# parse_cookies_header('myname=myvalue; max-age=0')
|
|
4461
|
+
# # => {"myname"=>"myvalue", "max-age"=>"0"}
|
|
4462
|
+
#
|
|
4463
|
+
# pkg:gem/rack#lib/rack/utils.rb:328
|
|
4464
|
+
def parse_cookies_header(value); end
|
|
4465
|
+
|
|
4466
|
+
# pkg:gem/rack#lib/rack/utils.rb:106
|
|
4467
|
+
def parse_nested_query(qs, d = T.unsafe(nil)); end
|
|
4468
|
+
|
|
4469
|
+
# pkg:gem/rack#lib/rack/utils.rb:102
|
|
4470
|
+
def parse_query(qs, d = T.unsafe(nil), &unescaper); end
|
|
4471
|
+
|
|
4472
|
+
# pkg:gem/rack#lib/rack/utils.rb:138
|
|
4473
|
+
def q_values(q_value_header); end
|
|
4474
|
+
|
|
4475
|
+
# pkg:gem/rack#lib/rack/utils.rb:485
|
|
4476
|
+
def rfc2822(time); end
|
|
4477
|
+
|
|
4478
|
+
# Constant time string comparison.
|
|
4479
|
+
#
|
|
4480
|
+
# NOTE: the values compared should be of fixed length, such as strings
|
|
4481
|
+
# that have already been processed by HMAC. This should not be used
|
|
4482
|
+
# on variable length plaintext strings because it could leak length info
|
|
4483
|
+
# via timing attacks.
|
|
4484
|
+
#
|
|
4485
|
+
# pkg:gem/rack#lib/rack/utils.rb:540
|
|
4486
|
+
def secure_compare(a, b); end
|
|
4487
|
+
|
|
4488
|
+
# Given an array of available encoding strings, and an array of
|
|
4489
|
+
# acceptable encodings for a request, where each element of the
|
|
4490
|
+
# acceptable encodings array is an array where the first element
|
|
4491
|
+
# is an encoding name and the second element is the numeric
|
|
4492
|
+
# priority for the encoding, return the available encoding with
|
|
4493
|
+
# the highest priority.
|
|
4494
|
+
#
|
|
4495
|
+
# The accept_encoding argument is typically generated by calling
|
|
4496
|
+
# Request#accept_encoding.
|
|
4497
|
+
#
|
|
4498
|
+
# Example:
|
|
4499
|
+
#
|
|
4500
|
+
# select_best_encoding(%w(compress gzip identity),
|
|
4501
|
+
# [["compress", 0.5], ["gzip", 1.0]])
|
|
4502
|
+
# # => "gzip"
|
|
4503
|
+
#
|
|
4504
|
+
# To reduce denial of service potential, only the first 16
|
|
4505
|
+
# acceptable encodings are considered.
|
|
4506
|
+
#
|
|
4507
|
+
# pkg:gem/rack#lib/rack/utils.rb:274
|
|
4508
|
+
def select_best_encoding(available_encodings, accept_encoding); end
|
|
4509
|
+
|
|
4510
|
+
# :call-seq:
|
|
4511
|
+
# set_cookie_header(key, value) -> encoded string
|
|
4512
|
+
#
|
|
4513
|
+
# Generate an encoded string using the provided +key+ and +value+ suitable
|
|
4514
|
+
# for the +set-cookie+ header according to RFC6265. The +value+ may be an
|
|
4515
|
+
# instance of either +String+ or +Hash+. If the cookie key is invalid (as
|
|
4516
|
+
# defined by RFC6265), an +ArgumentError+ will be raised.
|
|
4517
|
+
#
|
|
4518
|
+
# If the cookie +value+ is an instance of +Hash+, it considers the following
|
|
4519
|
+
# cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance
|
|
4520
|
+
# of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more
|
|
4521
|
+
# details about the interpretation of these fields, consult
|
|
4522
|
+
# [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2).
|
|
4523
|
+
#
|
|
4524
|
+
# set_cookie_header("myname", "myvalue")
|
|
4525
|
+
# # => "myname=myvalue"
|
|
4526
|
+
#
|
|
4527
|
+
# set_cookie_header("myname", {value: "myvalue", max_age: 10})
|
|
4528
|
+
# # => "myname=myvalue; max-age=10"
|
|
4529
|
+
#
|
|
4530
|
+
# pkg:gem/rack#lib/rack/utils.rb:376
|
|
4531
|
+
def set_cookie_header(key, value); end
|
|
4532
|
+
|
|
4533
|
+
# :call-seq:
|
|
4534
|
+
# set_cookie_header!(headers, key, value) -> header value
|
|
4535
|
+
#
|
|
4536
|
+
# Append a cookie in the specified headers with the given cookie +key+ and
|
|
4537
|
+
# +value+ using set_cookie_header.
|
|
4538
|
+
#
|
|
4539
|
+
# If the headers already contains a +set-cookie+ key, it will be converted
|
|
4540
|
+
# to an +Array+ if not already, and appended to.
|
|
4541
|
+
#
|
|
4542
|
+
# pkg:gem/rack#lib/rack/utils.rb:420
|
|
4543
|
+
def set_cookie_header!(headers, key, value); end
|
|
4544
|
+
|
|
4545
|
+
# pkg:gem/rack#lib/rack/utils.rb:674
|
|
4546
|
+
def status_code(status); end
|
|
4547
|
+
|
|
4548
|
+
# Unescapes a URI escaped string with +encoding+. +encoding+ will be the
|
|
4549
|
+
# target encoding of the string returned, and it defaults to UTF-8
|
|
4550
|
+
#
|
|
4551
|
+
# pkg:gem/rack#lib/rack/utils.rb:58
|
|
4552
|
+
def unescape(s, encoding = T.unsafe(nil)); end
|
|
4553
|
+
|
|
4554
|
+
# Unescapes the **path** component of a URI. See Rack::Utils.unescape for
|
|
4555
|
+
# unescaping query parameters or form components.
|
|
4556
|
+
#
|
|
4557
|
+
# pkg:gem/rack#lib/rack/utils.rb:52
|
|
4558
|
+
def unescape_path(s); end
|
|
4559
|
+
|
|
4560
|
+
# pkg:gem/rack#lib/rack/utils.rb:709
|
|
4561
|
+
def valid_path?(path); end
|
|
4562
|
+
end
|
|
4563
|
+
end
|
|
4564
|
+
|
|
4565
|
+
# pkg:gem/rack#lib/rack/utils.rb:149
|
|
4566
|
+
Rack::Utils::ALLOWED_FORWARED_PARAMS = T.let(T.unsafe(nil), Hash)
|
|
4567
|
+
|
|
4568
|
+
# pkg:gem/rack#lib/rack/utils.rb:25
|
|
4569
|
+
Rack::Utils::COMMON_SEP = T.let(T.unsafe(nil), Hash)
|
|
4570
|
+
|
|
4571
|
+
# Context allows the use of a compatible middleware at different points
|
|
4572
|
+
# in a request handling stack. A compatible middleware must define
|
|
4573
|
+
# #context which should take the arguments env and app. The first of which
|
|
4574
|
+
# would be the request environment. The second of which would be the rack
|
|
4575
|
+
# application that the request would be forwarded to.
|
|
4576
|
+
#
|
|
4577
|
+
# pkg:gem/rack#lib/rack/utils.rb:563
|
|
4578
|
+
class Rack::Utils::Context
|
|
4579
|
+
# pkg:gem/rack#lib/rack/utils.rb:566
|
|
4580
|
+
def initialize(app_f, app_r); end
|
|
4581
|
+
|
|
4582
|
+
# pkg:gem/rack#lib/rack/utils.rb:564
|
|
4583
|
+
def app; end
|
|
4584
|
+
|
|
4585
|
+
# pkg:gem/rack#lib/rack/utils.rb:571
|
|
4586
|
+
def call(env); end
|
|
4587
|
+
|
|
4588
|
+
# pkg:gem/rack#lib/rack/utils.rb:579
|
|
4589
|
+
def context(env, app = T.unsafe(nil)); end
|
|
4590
|
+
|
|
4591
|
+
# pkg:gem/rack#lib/rack/utils.rb:564
|
|
4592
|
+
def for; end
|
|
4593
|
+
|
|
4594
|
+
# pkg:gem/rack#lib/rack/utils.rb:575
|
|
4595
|
+
def recontext(app); end
|
|
4596
|
+
end
|
|
4597
|
+
|
|
4598
|
+
# pkg:gem/rack#lib/rack/utils.rb:24
|
|
4599
|
+
Rack::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
|
|
4600
|
+
|
|
4601
|
+
# Every standard HTTP code mapped to the appropriate message.
|
|
4602
|
+
# Generated with:
|
|
4603
|
+
# curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv \
|
|
4604
|
+
# | ruby -rcsv -e "puts CSV.parse(STDIN, headers: true) \
|
|
4605
|
+
# .reject {|v| v['Description'] == 'Unassigned' or v['Description'].include? '(' } \
|
|
4606
|
+
# .map {|v| %Q/#{v['Value']} => '#{v['Description']}'/ }.join(','+?\n)"
|
|
4607
|
+
#
|
|
4608
|
+
# pkg:gem/rack#lib/rack/utils.rb:590
|
|
4609
|
+
Rack::Utils::HTTP_STATUS_CODES = T.let(T.unsafe(nil), Hash)
|
|
4610
|
+
|
|
4611
|
+
# pkg:gem/rack#lib/rack/utils.rb:22
|
|
4612
|
+
Rack::Utils::InvalidParameterError = Rack::QueryParser::InvalidParameterError
|
|
4613
|
+
|
|
4614
|
+
# pkg:gem/rack#lib/rack/utils.rb:26
|
|
4615
|
+
Rack::Utils::KeySpaceConstrainedParams = Rack::QueryParser::Params
|
|
4616
|
+
|
|
4617
|
+
# pkg:gem/rack#lib/rack/utils.rb:707
|
|
4618
|
+
Rack::Utils::NULL_BYTE = T.let(T.unsafe(nil), String)
|
|
4619
|
+
|
|
4620
|
+
# pkg:gem/rack#lib/rack/utils.rb:660
|
|
4621
|
+
Rack::Utils::OBSOLETE_SYMBOLS_TO_STATUS_CODES = T.let(T.unsafe(nil), Hash)
|
|
4622
|
+
|
|
4623
|
+
# pkg:gem/rack#lib/rack/utils.rb:668
|
|
4624
|
+
Rack::Utils::OBSOLETE_SYMBOL_MAPPINGS = T.let(T.unsafe(nil), Hash)
|
|
4625
|
+
|
|
4626
|
+
# pkg:gem/rack#lib/rack/utils.rb:690
|
|
4627
|
+
Rack::Utils::PATH_SEPS = T.let(T.unsafe(nil), Regexp)
|
|
4628
|
+
|
|
4629
|
+
# pkg:gem/rack#lib/rack/utils.rb:21
|
|
4630
|
+
Rack::Utils::ParameterTypeError = Rack::QueryParser::ParameterTypeError
|
|
4631
|
+
|
|
4632
|
+
# pkg:gem/rack#lib/rack/utils.rb:23
|
|
4633
|
+
Rack::Utils::ParamsTooDeepError = Rack::QueryParser::QueryLimitError
|
|
4634
|
+
|
|
4635
|
+
# Responses with HTTP status codes that should not have an entity body
|
|
4636
|
+
#
|
|
4637
|
+
# pkg:gem/rack#lib/rack/utils.rb:654
|
|
4638
|
+
Rack::Utils::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash)
|
|
4639
|
+
|
|
4640
|
+
# pkg:gem/rack#lib/rack/utils.rb:656
|
|
4641
|
+
Rack::Utils::SYMBOL_TO_STATUS_CODE = T.let(T.unsafe(nil), Hash)
|
|
4642
|
+
|
|
4643
|
+
# pkg:gem/rack#lib/rack/utils.rb:27
|
|
4644
|
+
Rack::Utils::URI_PARSER = T.let(T.unsafe(nil), URI::RFC2396_Parser)
|
|
4645
|
+
|
|
4646
|
+
# A valid cookie key according to RFC6265 and RFC2616.
|
|
4647
|
+
# A <cookie-name> can be any US-ASCII characters, except control characters, spaces, or tabs. It also must not contain a separator character like the following: ( ) < > @ , ; : \ " / [ ] ? = { }.
|
|
4648
|
+
#
|
|
4649
|
+
# pkg:gem/rack#lib/rack/utils.rb:353
|
|
4650
|
+
Rack::Utils::VALID_COOKIE_KEY = T.let(T.unsafe(nil), Regexp)
|
|
4651
|
+
|
|
4652
|
+
# pkg:gem/rack#lib/rack/version.rb:9
|
|
4653
|
+
Rack::VERSION = T.let(T.unsafe(nil), String)
|