categoria 0.1.0.pre.beta0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +34 -0
  3. data/.ruby-version +1 -0
  4. data/CHANGELOG.md +5 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +33 -0
  7. data/Rakefile +12 -0
  8. data/categoria.gemspec +48 -0
  9. data/lib/categoria/version.rb +6 -0
  10. data/lib/categoria.rb +9 -0
  11. data/lib/generators/categoria/command_generator.rb +8 -0
  12. data/lib/generators/categoria/domain_generator.rb +35 -0
  13. data/lib/generators/categoria/model_generator.rb +8 -0
  14. data/lib/generators/categoria/templates/domain_module.rb.erb +6 -0
  15. data/sig/categoria.rbs +4 -0
  16. data/sorbet/config +4 -0
  17. data/sorbet/rbi/annotations/.gitattributes +1 -0
  18. data/sorbet/rbi/annotations/actionmailer.rbi +10 -0
  19. data/sorbet/rbi/annotations/actionpack.rbi +429 -0
  20. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  21. data/sorbet/rbi/annotations/activejob.rbi +44 -0
  22. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  23. data/sorbet/rbi/annotations/activerecord.rbi +92 -0
  24. data/sorbet/rbi/annotations/activesupport.rbi +421 -0
  25. data/sorbet/rbi/annotations/globalid.rbi +30 -0
  26. data/sorbet/rbi/annotations/railties.rbi +61 -0
  27. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  28. data/sorbet/rbi/gems/.gitattributes +1 -0
  29. data/sorbet/rbi/gems/actioncable@7.1.3.3.rbi +9 -0
  30. data/sorbet/rbi/gems/actionmailbox@7.1.3.3.rbi +9 -0
  31. data/sorbet/rbi/gems/actionmailer@7.1.3.3.rbi +9 -0
  32. data/sorbet/rbi/gems/actionpack@7.1.3.3.rbi +9 -0
  33. data/sorbet/rbi/gems/actiontext@7.1.3.3.rbi +9 -0
  34. data/sorbet/rbi/gems/actionview@7.1.3.3.rbi +9 -0
  35. data/sorbet/rbi/gems/activejob@7.1.3.3.rbi +9 -0
  36. data/sorbet/rbi/gems/activemodel@7.1.3.3.rbi +9 -0
  37. data/sorbet/rbi/gems/activerecord@7.1.3.3.rbi +9 -0
  38. data/sorbet/rbi/gems/activestorage@7.1.3.3.rbi +9 -0
  39. data/sorbet/rbi/gems/activesupport@7.1.3.3.rbi +11 -0
  40. data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
  41. data/sorbet/rbi/gems/base64@0.2.0.rbi +9 -0
  42. data/sorbet/rbi/gems/bigdecimal@3.1.8.rbi +9 -0
  43. data/sorbet/rbi/gems/builder@3.2.4.rbi +9 -0
  44. data/sorbet/rbi/gems/concurrent-ruby@1.3.1.rbi +9 -0
  45. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +9 -0
  46. data/sorbet/rbi/gems/crass@1.0.6.rbi +9 -0
  47. data/sorbet/rbi/gems/date@3.3.4.rbi +73 -0
  48. data/sorbet/rbi/gems/drb@2.2.1.rbi +9 -0
  49. data/sorbet/rbi/gems/erubi@1.12.0.rbi +146 -0
  50. data/sorbet/rbi/gems/globalid@1.2.1.rbi +9 -0
  51. data/sorbet/rbi/gems/i18n@1.14.5.rbi +9 -0
  52. data/sorbet/rbi/gems/io-console@0.7.2.rbi +9 -0
  53. data/sorbet/rbi/gems/json@2.7.2.rbi +1562 -0
  54. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
  55. data/sorbet/rbi/gems/loofah@2.22.0.rbi +9 -0
  56. data/sorbet/rbi/gems/mail@2.8.1.rbi +9 -0
  57. data/sorbet/rbi/gems/marcel@1.0.4.rbi +9 -0
  58. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +9 -0
  59. data/sorbet/rbi/gems/minitest@5.23.1.rbi +1555 -0
  60. data/sorbet/rbi/gems/mutex_m@0.2.0.rbi +9 -0
  61. data/sorbet/rbi/gems/net-imap@0.4.11.rbi +9 -0
  62. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +9 -0
  63. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +282 -0
  64. data/sorbet/rbi/gems/net-smtp@0.5.0.rbi +9 -0
  65. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  66. data/sorbet/rbi/gems/nio4r@2.7.3.rbi +9 -0
  67. data/sorbet/rbi/gems/nokogiri@1.16.5.rbi +9 -0
  68. data/sorbet/rbi/gems/parallel@1.24.0.rbi +281 -0
  69. data/sorbet/rbi/gems/parser@3.3.2.0.rbi +5519 -0
  70. data/sorbet/rbi/gems/prism@0.29.0.rbi +37987 -0
  71. data/sorbet/rbi/gems/psych@5.1.2.rbi +1732 -0
  72. data/sorbet/rbi/gems/racc@1.8.0.rbi +162 -0
  73. data/sorbet/rbi/gems/rack-session@2.0.0.rbi +9 -0
  74. data/sorbet/rbi/gems/rack-test@2.1.0.rbi +9 -0
  75. data/sorbet/rbi/gems/rack@3.0.11.rbi +2910 -0
  76. data/sorbet/rbi/gems/rackup@2.1.0.rbi +390 -0
  77. data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +9 -0
  78. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +9 -0
  79. data/sorbet/rbi/gems/rails@7.1.3.3.rbi +9 -0
  80. data/sorbet/rbi/gems/railties@7.1.3.3.rbi +9 -0
  81. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  82. data/sorbet/rbi/gems/rake@13.2.1.rbi +3028 -0
  83. data/sorbet/rbi/gems/rbi@0.1.13.rbi +3078 -0
  84. data/sorbet/rbi/gems/rdoc@6.7.0.rbi +12719 -0
  85. data/sorbet/rbi/gems/regexp_parser@2.9.2.rbi +3772 -0
  86. data/sorbet/rbi/gems/reline@0.5.8.rbi +9 -0
  87. data/sorbet/rbi/gems/rexml@3.2.8.rbi +4794 -0
  88. data/sorbet/rbi/gems/rubocop-ast@1.31.3.rbi +7045 -0
  89. data/sorbet/rbi/gems/rubocop-minitest@0.35.0.rbi +2611 -0
  90. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +329 -0
  91. data/sorbet/rbi/gems/rubocop-sorbet@0.8.3.rbi +1607 -0
  92. data/sorbet/rbi/gems/rubocop@1.64.1.rbi +58104 -0
  93. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  94. data/sorbet/rbi/gems/spoom@1.3.2.rbi +4421 -0
  95. data/sorbet/rbi/gems/stringio@3.1.0.rbi +9 -0
  96. data/sorbet/rbi/gems/strscan@3.1.0.rbi +9 -0
  97. data/sorbet/rbi/gems/tapioca@0.14.3.rbi +3534 -0
  98. data/sorbet/rbi/gems/thor@1.3.1.rbi +4352 -0
  99. data/sorbet/rbi/gems/timeout@0.4.1.rbi +143 -0
  100. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +9 -0
  101. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +66 -0
  102. data/sorbet/rbi/gems/webrick@1.8.1.rbi +2607 -0
  103. data/sorbet/rbi/gems/websocket-driver@0.7.6.rbi +9 -0
  104. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +9 -0
  105. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +429 -0
  106. data/sorbet/rbi/gems/yard@0.9.36.rbi +18412 -0
  107. data/sorbet/rbi/gems/zeitwerk@2.6.15.rbi +9 -0
  108. data/sorbet/rbi/todo.rbi +46 -0
  109. data/sorbet/tapioca/config.yml +13 -0
  110. data/sorbet/tapioca/require.rb +4 -0
  111. metadata +339 -0
@@ -0,0 +1,2910 @@
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
+ # The Rack main module, serving as a namespace for all core Rack
9
+ # modules and classes.
10
+ #
11
+ # All modules meant for use in your application are <tt>autoload</tt>ed here,
12
+ # so it should be enough just to <tt>require 'rack'</tt> in your code.
13
+ #
14
+ # source://rack//lib/rack/constants.rb#3
15
+ module Rack
16
+ class << self
17
+ # Return the Rack release as a dotted string.
18
+ #
19
+ # source://rack//lib/rack/version.rb#31
20
+ def release; end
21
+
22
+ # The Rack protocol version number implemented.
23
+ #
24
+ # source://rack//lib/rack/version.rb#23
25
+ def version; end
26
+ end
27
+ end
28
+
29
+ # Proxy for response bodies allowing calling a block when
30
+ # the response body is closed (after the response has been fully
31
+ # sent to the client).
32
+ #
33
+ # source://rack//lib/rack/body_proxy.rb#7
34
+ class Rack::BodyProxy
35
+ # Set the response body to wrap, and the block to call when the
36
+ # response has been fully sent.
37
+ #
38
+ # @return [BodyProxy] a new instance of BodyProxy
39
+ #
40
+ # source://rack//lib/rack/body_proxy.rb#10
41
+ def initialize(body, &block); end
42
+
43
+ # If not already closed, close the wrapped body and
44
+ # then call the block the proxy was initialized with.
45
+ #
46
+ # source://rack//lib/rack/body_proxy.rb#28
47
+ def close; end
48
+
49
+ # Whether the proxy is closed. The proxy starts as not closed,
50
+ # and becomes closed on the first call to close.
51
+ #
52
+ # @return [Boolean]
53
+ #
54
+ # source://rack//lib/rack/body_proxy.rb#40
55
+ def closed?; end
56
+
57
+ # Delegate missing methods to the wrapped body.
58
+ #
59
+ # source://rack//lib/rack/body_proxy.rb#45
60
+ def method_missing(method_name, *args, **_arg2, &block); end
61
+
62
+ private
63
+
64
+ # Return whether the wrapped body responds to the method.
65
+ #
66
+ # @return [Boolean]
67
+ #
68
+ # source://rack//lib/rack/body_proxy.rb#17
69
+ def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end
70
+ end
71
+
72
+ # Rack::Builder provides a domain-specific language (DSL) to construct Rack
73
+ # applications. It is primarily used to parse +config.ru+ files which
74
+ # instantiate several middleware and a final application which are hosted
75
+ # by a Rack-compatible web server.
76
+ #
77
+ # Example:
78
+ #
79
+ # app = Rack::Builder.new do
80
+ # use Rack::CommonLogger
81
+ # map "/ok" do
82
+ # run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] }
83
+ # end
84
+ # end
85
+ #
86
+ # run app
87
+ #
88
+ # Or
89
+ #
90
+ # app = Rack::Builder.app do
91
+ # use Rack::CommonLogger
92
+ # run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] }
93
+ # end
94
+ #
95
+ # run app
96
+ #
97
+ # +use+ adds middleware to the stack, +run+ dispatches to an application.
98
+ # You can use +map+ to construct a Rack::URLMap in a convenient way.
99
+ #
100
+ # source://rack//lib/rack/builder.rb#33
101
+ class Rack::Builder
102
+ # Initialize a new Rack::Builder instance. +default_app+ specifies the
103
+ # default application if +run+ is not called later. If a block
104
+ # is given, it is evaluated in the context of the instance.
105
+ #
106
+ # @return [Builder] a new instance of Builder
107
+ #
108
+ # source://rack//lib/rack/builder.rb#111
109
+ def initialize(default_app = T.unsafe(nil), &block); end
110
+
111
+ # Call the Rack application generated by this builder instance. Note that
112
+ # this rebuilds the Rack application and runs the warmup code (if any)
113
+ # every time it is called, so it should not be used if performance is important.
114
+ #
115
+ # source://rack//lib/rack/builder.rb#263
116
+ def call(env); end
117
+
118
+ # Freeze the app (set using run) and all middleware instances when building the application
119
+ # in to_app.
120
+ #
121
+ # source://rack//lib/rack/builder.rb#246
122
+ def freeze_app; end
123
+
124
+ # Creates a route within the application. Routes under the mapped path will be sent to
125
+ # the Rack application specified by run inside the block. Other requests will be sent to the
126
+ # default application specified by run outside the block.
127
+ #
128
+ # class App
129
+ # def call(env)
130
+ # [200, {'content-type' => 'text/plain'}, ["Hello World"]]
131
+ # end
132
+ # end
133
+ #
134
+ # class Heartbeat
135
+ # def call(env)
136
+ # [200, { "content-type" => "text/plain" }, ["OK"]]
137
+ # end
138
+ # end
139
+ #
140
+ # app = Rack::Builder.app do
141
+ # map '/heartbeat' do
142
+ # run Heartbeat.new
143
+ # end
144
+ # run App.new
145
+ # end
146
+ #
147
+ # run app
148
+ #
149
+ # The +use+ method can also be used inside the block to specify middleware to run under a specific path:
150
+ #
151
+ # app = Rack::Builder.app do
152
+ # map '/heartbeat' do
153
+ # use Middleware
154
+ # run Heartbeat.new
155
+ # end
156
+ # run App.new
157
+ # end
158
+ #
159
+ # This example includes a piece of middleware which will run before +/heartbeat+ requests hit +Heartbeat+.
160
+ #
161
+ # Note that providing a +path+ of +/+ will ignore any default application given in a +run+ statement
162
+ # outside the block.
163
+ #
164
+ # source://rack//lib/rack/builder.rb#239
165
+ def map(path, &block); end
166
+
167
+ # Takes a block or argument that is an object that responds to #call and
168
+ # returns a Rack response.
169
+ #
170
+ # You can use a block:
171
+ #
172
+ # run do |env|
173
+ # [200, { "content-type" => "text/plain" }, ["Hello World!"]]
174
+ # end
175
+ #
176
+ # You can also provide a lambda:
177
+ #
178
+ # run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] }
179
+ #
180
+ # You can also provide a class instance:
181
+ #
182
+ # class Heartbeat
183
+ # def call(env)
184
+ # [200, { "content-type" => "text/plain" }, ["OK"]]
185
+ # end
186
+ # end
187
+ #
188
+ # run Heartbeat.new
189
+ #
190
+ # @raise [ArgumentError]
191
+ #
192
+ # source://rack//lib/rack/builder.rb#180
193
+ def run(app = T.unsafe(nil), &block); end
194
+
195
+ # Return the Rack application generated by this instance.
196
+ #
197
+ # source://rack//lib/rack/builder.rb#251
198
+ def to_app; end
199
+
200
+ # Specifies middleware to use in a stack.
201
+ #
202
+ # class Middleware
203
+ # def initialize(app)
204
+ # @app = app
205
+ # end
206
+ #
207
+ # def call(env)
208
+ # env["rack.some_header"] = "setting an example"
209
+ # @app.call(env)
210
+ # end
211
+ # end
212
+ #
213
+ # use Middleware
214
+ # run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] }
215
+ #
216
+ # All requests through to this application will first be processed by the middleware class.
217
+ # The +call+ method in this example sets an additional environment key which then can be
218
+ # referenced in the application if required.
219
+ #
220
+ # source://rack//lib/rack/builder.rb#146
221
+ def use(middleware, *args, **_arg2, &block); end
222
+
223
+ # Takes a lambda or block that is used to warm-up the application. This block is called
224
+ # before the Rack application is returned by to_app.
225
+ #
226
+ # warmup do |app|
227
+ # client = Rack::MockRequest.new(app)
228
+ # client.get('/')
229
+ # end
230
+ #
231
+ # use SomeMiddleware
232
+ # run MyApp
233
+ #
234
+ # source://rack//lib/rack/builder.rb#196
235
+ def warmup(prc = T.unsafe(nil), &block); end
236
+
237
+ private
238
+
239
+ # Generate a URLMap instance by generating new Rack applications for each
240
+ # map block in this instance.
241
+ #
242
+ # source://rack//lib/rack/builder.rb#271
243
+ def generate_map(default_app, mapping); end
244
+
245
+ class << self
246
+ # Create a new Rack::Builder instance and return the Rack application
247
+ # generated from it.
248
+ #
249
+ # source://rack//lib/rack/builder.rb#123
250
+ def app(default_app = T.unsafe(nil), &block); end
251
+
252
+ # Load the given file as a rackup file, treating the
253
+ # contents as if specified inside a Rack::Builder block.
254
+ #
255
+ # Ignores content in the file after +__END__+, so that
256
+ # use of +__END__+ will not result in a syntax error.
257
+ #
258
+ # Example config.ru file:
259
+ #
260
+ # $ cat config.ru
261
+ #
262
+ # use Rack::ContentLength
263
+ # require './app.rb'
264
+ # run App
265
+ #
266
+ # source://rack//lib/rack/builder.rb#84
267
+ def load_file(path); end
268
+
269
+ # Evaluate the given +builder_script+ string in the context of
270
+ # a Rack::Builder block, returning a Rack application.
271
+ #
272
+ # source://rack//lib/rack/builder.rb#99
273
+ def new_from_string(builder_script, file = T.unsafe(nil)); end
274
+
275
+ # Parse the given config file to get a Rack application.
276
+ #
277
+ # If the config file ends in +.ru+, it is treated as a
278
+ # rackup file and the contents will be treated as if
279
+ # specified inside a Rack::Builder block.
280
+ #
281
+ # If the config file does not end in +.ru+, it is
282
+ # required and Rack will use the basename of the file
283
+ # to guess which constant will be the Rack application to run.
284
+ #
285
+ # Examples:
286
+ #
287
+ # Rack::Builder.parse_file('config.ru')
288
+ # # Rack application built using Rack::Builder.new
289
+ #
290
+ # Rack::Builder.parse_file('app.rb')
291
+ # # requires app.rb, which can be anywhere in Ruby's
292
+ # # load path. After requiring, assumes App constant
293
+ # # contains Rack application
294
+ #
295
+ # Rack::Builder.parse_file('./my_app.rb')
296
+ # # requires ./my_app.rb, which should be in the
297
+ # # process's current directory. After requiring,
298
+ # # assumes MyApp constant contains Rack application
299
+ #
300
+ # source://rack//lib/rack/builder.rb#62
301
+ def parse_file(path); end
302
+ end
303
+ end
304
+
305
+ # https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom
306
+ #
307
+ # source://rack//lib/rack/builder.rb#36
308
+ Rack::Builder::UTF_8_BOM = T.let(T.unsafe(nil), String)
309
+
310
+ # Response Header Keys
311
+ #
312
+ # source://rack//lib/rack/constants.rb#19
313
+ Rack::CACHE_CONTROL = T.let(T.unsafe(nil), String)
314
+
315
+ # source://rack//lib/rack/constants.rb#20
316
+ Rack::CONTENT_LENGTH = T.let(T.unsafe(nil), String)
317
+
318
+ # source://rack//lib/rack/constants.rb#21
319
+ Rack::CONTENT_TYPE = T.let(T.unsafe(nil), String)
320
+
321
+ # Rack::CommonLogger forwards every request to the given +app+, and
322
+ # logs a line in the
323
+ # {Apache common log format}[http://httpd.apache.org/docs/1.3/logs.html#common]
324
+ # to the configured logger.
325
+ #
326
+ # source://rack//lib/rack/common_logger.rb#13
327
+ class Rack::CommonLogger
328
+ # +logger+ can be any object that supports the +write+ or +<<+ methods,
329
+ # which includes the standard library Logger. These methods are called
330
+ # with a single string argument, the log message.
331
+ # If +logger+ is nil, CommonLogger will fall back <tt>env['rack.errors']</tt>.
332
+ #
333
+ # @return [CommonLogger] a new instance of CommonLogger
334
+ #
335
+ # source://rack//lib/rack/common_logger.rb#29
336
+ def initialize(app, logger = T.unsafe(nil)); end
337
+
338
+ # Log all requests in common_log format after a response has been
339
+ # returned. Note that if the app raises an exception, the request
340
+ # will not be logged, so if exception handling middleware are used,
341
+ # they should be loaded after this middleware. Additionally, because
342
+ # the logging happens after the request body has been fully sent, any
343
+ # exceptions raised during the sending of the response body will
344
+ # cause the request not to be logged.
345
+ #
346
+ # source://rack//lib/rack/common_logger.rb#41
347
+ def call(env); end
348
+
349
+ private
350
+
351
+ # Attempt to determine the content length for the response to
352
+ # include it in the logged data.
353
+ #
354
+ # source://rack//lib/rack/common_logger.rb#83
355
+ def extract_content_length(headers); end
356
+
357
+ # Log the request to the configured logger.
358
+ #
359
+ # source://rack//lib/rack/common_logger.rb#52
360
+ def log(env, status, response_headers, began_at); end
361
+ end
362
+
363
+ # Common Log Format: http://httpd.apache.org/docs/1.3/logs.html#common
364
+ #
365
+ # lilith.local - - [07/Aug/2006 23:58:02 -0400] "GET / HTTP/1.1" 500 -
366
+ #
367
+ # %{%s - %s [%s] "%s %s%s %s" %d %s\n} %
368
+ #
369
+ # The actual format is slightly different than the above due to the
370
+ # separation of SCRIPT_NAME and PATH_INFO, and because the elapsed
371
+ # time in seconds is included at the end.
372
+ #
373
+ # source://rack//lib/rack/common_logger.rb#23
374
+ Rack::CommonLogger::FORMAT = T.let(T.unsafe(nil), String)
375
+
376
+ # Sets the content-length header on responses that do not specify
377
+ # a content-length or transfer-encoding header. Note that this
378
+ # does not fix responses that have an invalid content-length
379
+ # header specified.
380
+ #
381
+ # source://rack//lib/rack/content_length.rb#12
382
+ class Rack::ContentLength
383
+ include ::Rack::Utils
384
+
385
+ # @return [ContentLength] a new instance of ContentLength
386
+ #
387
+ # source://rack//lib/rack/content_length.rb#15
388
+ def initialize(app); end
389
+
390
+ # source://rack//lib/rack/content_length.rb#19
391
+ def call(env); end
392
+ end
393
+
394
+ # source://rack//lib/rack/constants.rb#32
395
+ Rack::DELETE = T.let(T.unsafe(nil), String)
396
+
397
+ # source://rack//lib/rack/constants.rb#22
398
+ Rack::ETAG = T.let(T.unsafe(nil), String)
399
+
400
+ # source://rack//lib/rack/constants.rb#23
401
+ Rack::EXPIRES = T.let(T.unsafe(nil), String)
402
+
403
+ # HTTP method verbs
404
+ #
405
+ # source://rack//lib/rack/constants.rb#28
406
+ Rack::GET = T.let(T.unsafe(nil), String)
407
+
408
+ # source://rack//lib/rack/constants.rb#33
409
+ Rack::HEAD = T.let(T.unsafe(nil), String)
410
+
411
+ # source://rack//lib/rack/constants.rb#7
412
+ Rack::HTTPS = T.let(T.unsafe(nil), String)
413
+
414
+ # source://rack//lib/rack/constants.rb#16
415
+ Rack::HTTP_COOKIE = T.let(T.unsafe(nil), String)
416
+
417
+ # Request env keys
418
+ #
419
+ # source://rack//lib/rack/constants.rb#5
420
+ Rack::HTTP_HOST = T.let(T.unsafe(nil), String)
421
+
422
+ # source://rack//lib/rack/constants.rb#6
423
+ Rack::HTTP_PORT = T.let(T.unsafe(nil), String)
424
+
425
+ # Rack::Headers is a Hash subclass that downcases all keys. It's designed
426
+ # to be used by rack applications that don't implement the Rack 3 SPEC
427
+ # (by using non-lowercase response header keys), automatically handling
428
+ # the downcasing of keys.
429
+ #
430
+ # source://rack//lib/rack/headers.rb#6
431
+ class Rack::Headers < ::Hash
432
+ # source://rack//lib/rack/headers.rb#26
433
+ def [](key); end
434
+
435
+ # source://rack//lib/rack/headers.rb#30
436
+ def []=(key, value); end
437
+
438
+ # source://rack//lib/rack/headers.rb#35
439
+ def assoc(key); end
440
+
441
+ # @raise [TypeError]
442
+ #
443
+ # source://rack//lib/rack/headers.rb#39
444
+ def compare_by_identity; end
445
+
446
+ # source://rack//lib/rack/headers.rb#43
447
+ def delete(key); end
448
+
449
+ # source://rack//lib/rack/headers.rb#47
450
+ def dig(key, *a); end
451
+
452
+ # :nocov:
453
+ #
454
+ # source://rack//lib/rack/headers.rb#143
455
+ def except(*a); end
456
+
457
+ # source://rack//lib/rack/headers.rb#51
458
+ def fetch(key, *default, &block); end
459
+
460
+ # source://rack//lib/rack/headers.rb#56
461
+ def fetch_values(*a); end
462
+
463
+ # @return [Boolean]
464
+ #
465
+ # source://rack//lib/rack/headers.rb#60
466
+ def has_key?(key); end
467
+
468
+ # @return [Boolean]
469
+ #
470
+ # source://rack//lib/rack/headers.rb#60
471
+ def include?(key); end
472
+
473
+ # source://rack//lib/rack/headers.rb#67
474
+ def invert; end
475
+
476
+ # @return [Boolean]
477
+ #
478
+ # source://rack//lib/rack/headers.rb#60
479
+ def key?(key); end
480
+
481
+ # @return [Boolean]
482
+ #
483
+ # source://rack//lib/rack/headers.rb#60
484
+ def member?(key); end
485
+
486
+ # source://rack//lib/rack/headers.rb#73
487
+ def merge(hash, &block); end
488
+
489
+ # source://rack//lib/rack/headers.rb#102
490
+ def merge!(hash, &block); end
491
+
492
+ # source://rack//lib/rack/headers.rb#77
493
+ def reject(&block); end
494
+
495
+ # source://rack//lib/rack/headers.rb#83
496
+ def replace(hash); end
497
+
498
+ # source://rack//lib/rack/headers.rb#88
499
+ def select(&block); end
500
+
501
+ # :nocov:
502
+ #
503
+ # source://rack//lib/rack/headers.rb#121
504
+ def slice(*a); end
505
+
506
+ # source://rack//lib/rack/headers.rb#30
507
+ def store(key, value); end
508
+
509
+ # source://rack//lib/rack/headers.rb#94
510
+ def to_proc; end
511
+
512
+ # source://rack//lib/rack/headers.rb#127
513
+ def transform_keys(&block); end
514
+
515
+ # source://rack//lib/rack/headers.rb#131
516
+ def transform_keys!; end
517
+
518
+ # source://rack//lib/rack/headers.rb#98
519
+ def transform_values(&block); end
520
+
521
+ # source://rack//lib/rack/headers.rb#102
522
+ def update(hash, &block); end
523
+
524
+ # source://rack//lib/rack/headers.rb#114
525
+ def values_at(*keys); end
526
+
527
+ private
528
+
529
+ # source://rack//lib/rack/headers.rb#150
530
+ def downcase_key(key); end
531
+
532
+ class << self
533
+ # source://rack//lib/rack/headers.rb#7
534
+ def [](*items); end
535
+ end
536
+ end
537
+
538
+ # source://rack//lib/rack/constants.rb#35
539
+ Rack::LINK = T.let(T.unsafe(nil), String)
540
+
541
+ # Rack::Lint validates your application and the requests and
542
+ # responses according to the Rack spec.
543
+ #
544
+ # source://rack//lib/rack/lint.rb#12
545
+ class Rack::Lint
546
+ # @return [Lint] a new instance of Lint
547
+ #
548
+ # source://rack//lib/rack/lint.rb#13
549
+ def initialize(app); end
550
+
551
+ # AUTHORS: n.b. The trailing whitespace between paragraphs is important and
552
+ # should not be removed. The whitespace creates paragraphs in the RDoc
553
+ # output.
554
+ #
555
+ # This specification aims to formalize the Rack protocol. You
556
+ # can (and should) use Rack::Lint to enforce it.
557
+ #
558
+ # When you develop middleware, be sure to add a Lint before and
559
+ # after to catch all mistakes.
560
+ #
561
+ # = Rack applications
562
+ #
563
+ # A Rack application is a Ruby object (not a class) that
564
+ # responds to +call+.
565
+ #
566
+ # source://rack//lib/rack/lint.rb#34
567
+ def call(env = T.unsafe(nil)); end
568
+ end
569
+
570
+ # :stopdoc:
571
+ #
572
+ # source://rack//lib/rack/lint.rb#19
573
+ class Rack::Lint::LintError < ::RuntimeError; end
574
+
575
+ # source://rack//lib/rack/lint.rb#38
576
+ class Rack::Lint::Wrapper
577
+ # @return [Wrapper] a new instance of Wrapper
578
+ #
579
+ # source://rack//lib/rack/lint.rb#39
580
+ def initialize(app, env); end
581
+
582
+ # ==== Streaming Body
583
+ #
584
+ # @raise [LintError]
585
+ #
586
+ # source://rack//lib/rack/lint.rb#855
587
+ def call(stream); end
588
+
589
+ # === The content-length
590
+ #
591
+ # source://rack//lib/rack/lint.rb#693
592
+ def check_content_length(status, headers); end
593
+
594
+ # === The content-type
595
+ #
596
+ # source://rack//lib/rack/lint.rb#677
597
+ def check_content_type(status, headers); end
598
+
599
+ # == The Environment
600
+ #
601
+ # @raise [LintError]
602
+ #
603
+ # source://rack//lib/rack/lint.rb#97
604
+ def check_environment(env); end
605
+
606
+ # === The Error Stream
607
+ #
608
+ # source://rack//lib/rack/lint.rb#491
609
+ def check_error(error); end
610
+
611
+ # source://rack//lib/rack/lint.rb#667
612
+ def check_header_value(key, value); end
613
+
614
+ # === The Headers
615
+ #
616
+ # source://rack//lib/rack/lint.rb#627
617
+ def check_headers(headers); end
618
+
619
+ # === Hijacking
620
+ #
621
+ # The hijacking interfaces provides a means for an application to take
622
+ # control of the HTTP connection. There are two distinct hijack
623
+ # interfaces: full hijacking where the application takes over the raw
624
+ # connection, and partial hijacking where the application takes over
625
+ # just the response body stream. In both cases, the application is
626
+ # responsible for closing the hijacked stream.
627
+ #
628
+ # Full hijacking only works with HTTP/1. Partial hijacking is functionally
629
+ # equivalent to streaming bodies, and is still optionally supported for
630
+ # backwards compatibility with older Rack versions.
631
+ #
632
+ # ==== Full Hijack
633
+ #
634
+ # Full hijack is used to completely take over an HTTP/1 connection. It
635
+ # occurs before any headers are written and causes the request to
636
+ # ignores any response generated by the application.
637
+ #
638
+ # It is intended to be used when applications need access to raw HTTP/1
639
+ # connection.
640
+ #
641
+ # source://rack//lib/rack/lint.rb#551
642
+ def check_hijack(env); end
643
+
644
+ # ==== Partial Hijack
645
+ #
646
+ # Partial hijack is used for bi-directional streaming of the request and
647
+ # response body. It occurs after the status and headers are written by
648
+ # the server and causes the server to ignore the Body of the response.
649
+ #
650
+ # It is intended to be used when applications need bi-directional
651
+ # streaming.
652
+ #
653
+ # source://rack//lib/rack/lint.rb#579
654
+ def check_hijack_response(headers, env); end
655
+
656
+ # === The Input Stream
657
+ #
658
+ # The input stream is an IO-like object which contains the raw HTTP
659
+ # POST data.
660
+ #
661
+ # source://rack//lib/rack/lint.rb#387
662
+ def check_input(input); end
663
+
664
+ # == The Response
665
+ #
666
+ # === The Status
667
+ #
668
+ # source://rack//lib/rack/lint.rb#616
669
+ def check_status(status); end
670
+
671
+ # === The Body
672
+ #
673
+ # The Body is typically an +Array+ of +String+ instances, an enumerable
674
+ # that yields +String+ instances, a +Proc+ instance, or a File-like
675
+ # object.
676
+ #
677
+ # The Body must respond to +each+ or +call+. It may optionally respond
678
+ # to +to_path+ or +to_ary+. A Body that responds to +each+ is considered
679
+ # to be an Enumerable Body. A Body that responds to +call+ is considered
680
+ # to be a Streaming Body.
681
+ #
682
+ # A Body that responds to both +each+ and +call+ must be treated as an
683
+ # Enumerable Body, not a Streaming Body. If it responds to +each+, you
684
+ # must call +each+ and not +call+. If the Body doesn't respond to
685
+ # +each+, then you can assume it responds to +call+.
686
+ #
687
+ # The Body must either be consumed or returned. The Body is consumed by
688
+ # optionally calling either +each+ or +call+.
689
+ # Then, if the Body responds to +close+, it must be called to release
690
+ # any resources associated with the generation of the body.
691
+ # In other words, +close+ must always be called at least once; typically
692
+ # after the web server has sent the response to the client, but also in
693
+ # cases where the Rack application makes internal/virtual requests and
694
+ # discards the response.
695
+ #
696
+ # source://rack//lib/rack/lint.rb#744
697
+ def close; end
698
+
699
+ # ==== Enumerable Body
700
+ #
701
+ # @raise [LintError]
702
+ #
703
+ # source://rack//lib/rack/lint.rb#778
704
+ def each; end
705
+
706
+ # @return [Boolean]
707
+ #
708
+ # source://rack//lib/rack/lint.rb#826
709
+ def respond_to?(name, *_arg1); end
710
+
711
+ # @raise [LintError]
712
+ #
713
+ # source://rack//lib/rack/lint.rb#54
714
+ def response; end
715
+
716
+ # If the Body responds to +to_ary+, it must return an +Array+ whose
717
+ # contents are identical to that produced by calling +each+.
718
+ # Middleware may call +to_ary+ directly on the Body and return a new
719
+ # Body in its place. In other words, middleware can only process the
720
+ # Body directly if it responds to +to_ary+. If the Body responds to both
721
+ # +to_ary+ and +close+, its implementation of +to_ary+ must call
722
+ # +close+.
723
+ #
724
+ # source://rack//lib/rack/lint.rb#842
725
+ def to_ary; end
726
+
727
+ # source://rack//lib/rack/lint.rb#822
728
+ def to_path; end
729
+
730
+ # source://rack//lib/rack/lint.rb#706
731
+ def verify_content_length(size); end
732
+
733
+ # source://rack//lib/rack/lint.rb#760
734
+ def verify_to_path; end
735
+ end
736
+
737
+ # source://rack//lib/rack/lint.rb#820
738
+ Rack::Lint::Wrapper::BODY_METHODS = T.let(T.unsafe(nil), Hash)
739
+
740
+ # source://rack//lib/rack/lint.rb#500
741
+ class Rack::Lint::Wrapper::ErrorWrapper
742
+ # @return [ErrorWrapper] a new instance of ErrorWrapper
743
+ #
744
+ # source://rack//lib/rack/lint.rb#501
745
+ def initialize(error); end
746
+
747
+ # * +close+ must never be called on the error stream.
748
+ #
749
+ # @raise [LintError]
750
+ #
751
+ # source://rack//lib/rack/lint.rb#523
752
+ def close(*args); end
753
+
754
+ # * +flush+ must be called without arguments and must be called
755
+ # in order to make the error appear for sure.
756
+ #
757
+ # source://rack//lib/rack/lint.rb#518
758
+ def flush; end
759
+
760
+ # * +puts+ must be called with a single argument that responds to +to_s+.
761
+ #
762
+ # source://rack//lib/rack/lint.rb#506
763
+ def puts(str); end
764
+
765
+ # * +write+ must be called with a single argument that is a String.
766
+ #
767
+ # @raise [LintError]
768
+ #
769
+ # source://rack//lib/rack/lint.rb#511
770
+ def write(str); end
771
+ end
772
+
773
+ # source://rack//lib/rack/lint.rb#405
774
+ class Rack::Lint::Wrapper::InputWrapper
775
+ # @return [InputWrapper] a new instance of InputWrapper
776
+ #
777
+ # source://rack//lib/rack/lint.rb#406
778
+ def initialize(input); end
779
+
780
+ # * +close+ can be called on the input stream to indicate that the
781
+ # any remaining input is not needed.
782
+ #
783
+ # source://rack//lib/rack/lint.rb#483
784
+ def close(*args); end
785
+
786
+ # * +each+ must be called without arguments and only yield Strings.
787
+ #
788
+ # @raise [LintError]
789
+ #
790
+ # source://rack//lib/rack/lint.rb#471
791
+ def each(*args); end
792
+
793
+ # * +gets+ must be called without arguments and return a string,
794
+ # or +nil+ on EOF.
795
+ #
796
+ # @raise [LintError]
797
+ #
798
+ # source://rack//lib/rack/lint.rb#412
799
+ def gets(*args); end
800
+
801
+ # * +read+ behaves like IO#read.
802
+ # Its signature is <tt>read([length, [buffer]])</tt>.
803
+ #
804
+ # If given, +length+ must be a non-negative Integer (>= 0) or +nil+,
805
+ # and +buffer+ must be a String and may not be nil.
806
+ #
807
+ # If +length+ is given and not nil, then this method reads at most
808
+ # +length+ bytes from the input stream.
809
+ #
810
+ # If +length+ is not given or nil, then this method reads
811
+ # all data until EOF.
812
+ #
813
+ # When EOF is reached, this method returns nil if +length+ is given
814
+ # and not nil, or "" if +length+ is not given or is nil.
815
+ #
816
+ # If +buffer+ is given, then the read data will be placed
817
+ # into +buffer+ instead of a newly created String object.
818
+ #
819
+ # source://rack//lib/rack/lint.rb#438
820
+ def read(*args); end
821
+ end
822
+
823
+ # source://rack//lib/rack/lint.rb#875
824
+ class Rack::Lint::Wrapper::StreamWrapper
825
+ extend ::Forwardable
826
+
827
+ # @return [StreamWrapper] a new instance of StreamWrapper
828
+ #
829
+ # source://rack//lib/rack/lint.rb#890
830
+ def initialize(stream); end
831
+
832
+ # source://forwardable/1.3.3/forwardable.rb#231
833
+ def <<(*args, **_arg1, &block); end
834
+
835
+ # source://forwardable/1.3.3/forwardable.rb#231
836
+ def close(*args, **_arg1, &block); end
837
+
838
+ # source://forwardable/1.3.3/forwardable.rb#231
839
+ def close_read(*args, **_arg1, &block); end
840
+
841
+ # source://forwardable/1.3.3/forwardable.rb#231
842
+ def close_write(*args, **_arg1, &block); end
843
+
844
+ # source://forwardable/1.3.3/forwardable.rb#231
845
+ def closed?(*args, **_arg1, &block); end
846
+
847
+ # source://forwardable/1.3.3/forwardable.rb#231
848
+ def flush(*args, **_arg1, &block); end
849
+
850
+ # source://forwardable/1.3.3/forwardable.rb#231
851
+ def read(*args, **_arg1, &block); end
852
+
853
+ # source://forwardable/1.3.3/forwardable.rb#231
854
+ def write(*args, **_arg1, &block); end
855
+ end
856
+
857
+ # The semantics of these IO methods must be a best effort match to
858
+ # those of a normal Ruby IO or Socket object, using standard arguments
859
+ # and raising standard exceptions. Servers are encouraged to simply
860
+ # pass on real IO objects, although it is recognized that this approach
861
+ # is not directly compatible with HTTP/2.
862
+ #
863
+ # source://rack//lib/rack/lint.rb#883
864
+ Rack::Lint::Wrapper::StreamWrapper::REQUIRED_METHODS = T.let(T.unsafe(nil), Array)
865
+
866
+ # Rack::MediaType parse media type and parameters out of content_type string
867
+ #
868
+ # source://rack//lib/rack/media_type.rb#6
869
+ class Rack::MediaType
870
+ class << self
871
+ # The media type parameters provided in CONTENT_TYPE as a Hash, or
872
+ # an empty Hash if no CONTENT_TYPE or media-type parameters were
873
+ # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8",
874
+ # this method responds with the following Hash:
875
+ # { 'charset' => 'utf-8' }
876
+ #
877
+ # source://rack//lib/rack/media_type.rb#30
878
+ def params(content_type); end
879
+
880
+ # The media type (type/subtype) portion of the CONTENT_TYPE header
881
+ # without any media type parameters. e.g., when CONTENT_TYPE is
882
+ # "text/plain;charset=utf-8", the media-type is "text/plain".
883
+ #
884
+ # For more information on the use of media types in HTTP, see:
885
+ # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
886
+ #
887
+ # source://rack//lib/rack/media_type.rb#16
888
+ def type(content_type); end
889
+
890
+ private
891
+
892
+ # source://rack//lib/rack/media_type.rb#43
893
+ def strip_doublequotes(str); end
894
+ end
895
+ end
896
+
897
+ # source://rack//lib/rack/media_type.rb#7
898
+ Rack::MediaType::SPLIT_PATTERN = T.let(T.unsafe(nil), Regexp)
899
+
900
+ # source://rack//lib/rack/mime.rb#4
901
+ module Rack::Mime
902
+ private
903
+
904
+ # Returns true if the given value is a mime match for the given mime match
905
+ # specification, false otherwise.
906
+ #
907
+ # Rack::Mime.match?('text/html', 'text/*') => true
908
+ # Rack::Mime.match?('text/plain', '*') => true
909
+ # Rack::Mime.match?('text/html', 'application/json') => false
910
+ #
911
+ # @return [Boolean]
912
+ #
913
+ # source://rack//lib/rack/mime.rb#30
914
+ def match?(value, matcher); end
915
+
916
+ # Returns String with mime type if found, otherwise use +fallback+.
917
+ # +ext+ should be filename extension in the '.ext' format that
918
+ # File.extname(file) returns.
919
+ # +fallback+ may be any object
920
+ #
921
+ # Also see the documentation for MIME_TYPES
922
+ #
923
+ # Usage:
924
+ # Rack::Mime.mime_type('.foo')
925
+ #
926
+ # This is a shortcut for:
927
+ # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')
928
+ #
929
+ # source://rack//lib/rack/mime.rb#18
930
+ def mime_type(ext, fallback = T.unsafe(nil)); end
931
+
932
+ class << self
933
+ # Returns true if the given value is a mime match for the given mime match
934
+ # specification, false otherwise.
935
+ #
936
+ # Rack::Mime.match?('text/html', 'text/*') => true
937
+ # Rack::Mime.match?('text/plain', '*') => true
938
+ # Rack::Mime.match?('text/html', 'application/json') => false
939
+ #
940
+ # @return [Boolean]
941
+ #
942
+ # source://rack//lib/rack/mime.rb#30
943
+ def match?(value, matcher); end
944
+
945
+ # Returns String with mime type if found, otherwise use +fallback+.
946
+ # +ext+ should be filename extension in the '.ext' format that
947
+ # File.extname(file) returns.
948
+ # +fallback+ may be any object
949
+ #
950
+ # Also see the documentation for MIME_TYPES
951
+ #
952
+ # Usage:
953
+ # Rack::Mime.mime_type('.foo')
954
+ #
955
+ # This is a shortcut for:
956
+ # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')
957
+ #
958
+ # source://rack//lib/rack/mime.rb#18
959
+ def mime_type(ext, fallback = T.unsafe(nil)); end
960
+ end
961
+ end
962
+
963
+ # List of most common mime-types, selected various sources
964
+ # according to their usefulness in a webserving scope for Ruby
965
+ # users.
966
+ #
967
+ # To amend this list with your local mime.types list you can use:
968
+ #
969
+ # require 'webrick/httputils'
970
+ # list = WEBrick::HTTPUtils.load_mime_types('/etc/mime.types')
971
+ # Rack::Mime::MIME_TYPES.merge!(list)
972
+ #
973
+ # N.B. On Ubuntu the mime.types file does not include the leading period, so
974
+ # users may need to modify the data before merging into the hash.
975
+ #
976
+ # source://rack//lib/rack/mime.rb#51
977
+ Rack::Mime::MIME_TYPES = T.let(T.unsafe(nil), Hash)
978
+
979
+ # A multipart form data parser, adapted from IOWA.
980
+ #
981
+ # Usually, Rack::Request#POST takes care of calling this.
982
+ #
983
+ # source://rack//lib/rack/multipart/parser.rb#8
984
+ module Rack::Multipart
985
+ class << self
986
+ # source://rack//lib/rack/multipart.rb#39
987
+ def build_multipart(params, first = T.unsafe(nil)); end
988
+
989
+ # source://rack//lib/rack/multipart.rb#35
990
+ def extract_multipart(request, params = T.unsafe(nil)); end
991
+
992
+ # source://rack//lib/rack/multipart.rb#17
993
+ def parse_multipart(env, params = T.unsafe(nil)); end
994
+ end
995
+ end
996
+
997
+ # source://rack//lib/rack/multipart/parser.rb#32
998
+ Rack::Multipart::ATTRIBUTE = T.let(T.unsafe(nil), Regexp)
999
+
1000
+ # Updated definitions from RFC 2231
1001
+ #
1002
+ # source://rack//lib/rack/multipart/parser.rb#31
1003
+ Rack::Multipart::ATTRIBUTE_CHAR = T.let(T.unsafe(nil), Regexp)
1004
+
1005
+ # source://rack//lib/rack/multipart/parser.rb#26
1006
+ Rack::Multipart::BROKEN = T.let(T.unsafe(nil), Regexp)
1007
+
1008
+ # source://rack//lib/rack/multipart/parser.rb#24
1009
+ Rack::Multipart::CONDISP = T.let(T.unsafe(nil), Regexp)
1010
+
1011
+ # source://rack//lib/rack/multipart/parser.rb#43
1012
+ Rack::Multipart::DISPPARM = T.let(T.unsafe(nil), Regexp)
1013
+
1014
+ # source://rack//lib/rack/multipart/parser.rb#21
1015
+ Rack::Multipart::EOL = T.let(T.unsafe(nil), String)
1016
+
1017
+ # source://rack//lib/rack/multipart/parser.rb#39
1018
+ Rack::Multipart::EXTENDED_INITIAL_NAME = T.let(T.unsafe(nil), Regexp)
1019
+
1020
+ # source://rack//lib/rack/multipart/parser.rb#41
1021
+ Rack::Multipart::EXTENDED_INITIAL_PARAMETER = T.let(T.unsafe(nil), Regexp)
1022
+
1023
+ # source://rack//lib/rack/multipart/parser.rb#40
1024
+ Rack::Multipart::EXTENDED_INITIAL_VALUE = T.let(T.unsafe(nil), Regexp)
1025
+
1026
+ # source://rack//lib/rack/multipart/parser.rb#36
1027
+ Rack::Multipart::EXTENDED_OTHER_NAME = T.let(T.unsafe(nil), Regexp)
1028
+
1029
+ # source://rack//lib/rack/multipart/parser.rb#38
1030
+ Rack::Multipart::EXTENDED_OTHER_PARAMETER = T.let(T.unsafe(nil), Regexp)
1031
+
1032
+ # source://rack//lib/rack/multipart/parser.rb#37
1033
+ Rack::Multipart::EXTENDED_OTHER_VALUE = T.let(T.unsafe(nil), Regexp)
1034
+
1035
+ # source://rack//lib/rack/multipart/parser.rb#42
1036
+ Rack::Multipart::EXTENDED_PARAMETER = T.let(T.unsafe(nil), Regexp)
1037
+
1038
+ # Use specific error class when parsing multipart request
1039
+ # that ends early.
1040
+ #
1041
+ # source://rack//lib/rack/multipart/parser.rb#15
1042
+ class Rack::Multipart::EmptyContentError < ::EOFError; end
1043
+
1044
+ # Base class for multipart exceptions that do not subclass from
1045
+ # other exception classes for backwards compatibility.
1046
+ #
1047
+ # source://rack//lib/rack/multipart/parser.rb#19
1048
+ class Rack::Multipart::Error < ::StandardError; end
1049
+
1050
+ # source://rack//lib/rack/multipart/generator.rb#7
1051
+ class Rack::Multipart::Generator
1052
+ # @return [Generator] a new instance of Generator
1053
+ #
1054
+ # source://rack//lib/rack/multipart/generator.rb#8
1055
+ def initialize(params, first = T.unsafe(nil)); end
1056
+
1057
+ # source://rack//lib/rack/multipart/generator.rb#16
1058
+ def dump; end
1059
+
1060
+ private
1061
+
1062
+ # source://rack//lib/rack/multipart/generator.rb#89
1063
+ def content_for_other(file, name); end
1064
+
1065
+ # source://rack//lib/rack/multipart/generator.rb#77
1066
+ def content_for_tempfile(io, file, name); end
1067
+
1068
+ # source://rack//lib/rack/multipart/generator.rb#52
1069
+ def flattened_params; end
1070
+
1071
+ # @return [Boolean]
1072
+ #
1073
+ # source://rack//lib/rack/multipart/generator.rb#37
1074
+ def multipart?; end
1075
+ end
1076
+
1077
+ # source://rack//lib/rack/multipart/parser.rb#22
1078
+ Rack::Multipart::MULTIPART = T.let(T.unsafe(nil), Regexp)
1079
+
1080
+ # source://rack//lib/rack/multipart.rb#14
1081
+ Rack::Multipart::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
1082
+
1083
+ # source://rack//lib/rack/multipart/parser.rb#28
1084
+ Rack::Multipart::MULTIPART_CONTENT_DISPOSITION = T.let(T.unsafe(nil), Regexp)
1085
+
1086
+ # source://rack//lib/rack/multipart/parser.rb#29
1087
+ Rack::Multipart::MULTIPART_CONTENT_ID = T.let(T.unsafe(nil), Regexp)
1088
+
1089
+ # source://rack//lib/rack/multipart/parser.rb#27
1090
+ Rack::Multipart::MULTIPART_CONTENT_TYPE = T.let(T.unsafe(nil), Regexp)
1091
+
1092
+ # source://rack//lib/rack/multipart/parser.rb#9
1093
+ class Rack::Multipart::MultipartPartLimitError < ::Errno::EMFILE; end
1094
+
1095
+ # source://rack//lib/rack/multipart/parser.rb#11
1096
+ class Rack::Multipart::MultipartTotalPartLimitError < ::StandardError; end
1097
+
1098
+ # source://rack//lib/rack/multipart/parser.rb#46
1099
+ class Rack::Multipart::Parser
1100
+ # @return [Parser] a new instance of Parser
1101
+ #
1102
+ # source://rack//lib/rack/multipart/parser.rb#205
1103
+ def initialize(boundary, tempfile, bufsize, query_parser); end
1104
+
1105
+ # source://rack//lib/rack/multipart/parser.rb#221
1106
+ def parse(io); end
1107
+
1108
+ # source://rack//lib/rack/multipart/parser.rb#244
1109
+ def result; end
1110
+
1111
+ # Returns the value of attribute state.
1112
+ #
1113
+ # source://rack//lib/rack/multipart/parser.rb#203
1114
+ def state; end
1115
+
1116
+ private
1117
+
1118
+ # Scan until the we find the start or end of the boundary.
1119
+ # If we find it, return the appropriate symbol for the start or
1120
+ # end of the boundary. If we don't find the start or end of the
1121
+ # boundary, clear the buffer and return nil.
1122
+ #
1123
+ # source://rack//lib/rack/multipart/parser.rb#354
1124
+ def consume_boundary; end
1125
+
1126
+ # From WEBrick::HTTPUtils
1127
+ #
1128
+ # source://rack//lib/rack/multipart/parser.rb#256
1129
+ def dequote(str); end
1130
+
1131
+ # source://rack//lib/rack/multipart/parser.rb#363
1132
+ def get_filename(head); end
1133
+
1134
+ # source://rack//lib/rack/multipart/parser.rb#298
1135
+ def handle_consume_token; end
1136
+
1137
+ # source://rack//lib/rack/multipart/parser.rb#435
1138
+ def handle_empty_content!(content); end
1139
+
1140
+ # This handles the initial parser state. We read until we find the starting
1141
+ # boundary, then we can transition to the next state. If we find the ending
1142
+ # boundary, this is an invalid multipart upload, but keep scanning for opening
1143
+ # boundary in that case. If no boundary found, we need to keep reading data
1144
+ # and retry. It's highly unlikely the initial read will not consume the
1145
+ # boundary. The client would have to deliberately craft a response
1146
+ # with the opening boundary beyond the buffer size for that to happen.
1147
+ #
1148
+ # source://rack//lib/rack/multipart/parser.rb#275
1149
+ def handle_fast_forward; end
1150
+
1151
+ # source://rack//lib/rack/multipart/parser.rb#331
1152
+ def handle_mime_body; end
1153
+
1154
+ # source://rack//lib/rack/multipart/parser.rb#308
1155
+ def handle_mime_head; end
1156
+
1157
+ # source://rack//lib/rack/multipart/parser.rb#262
1158
+ def read_data(io, outbuf); end
1159
+
1160
+ # source://rack//lib/rack/multipart/parser.rb#401
1161
+ def tag_multipart_encoding(filename, content_type, name, body); end
1162
+
1163
+ class << self
1164
+ # source://rack//lib/rack/multipart/parser.rb#92
1165
+ def parse(io, content_length, content_type, tmpfile, bufsize, qp); end
1166
+
1167
+ # source://rack//lib/rack/multipart/parser.rb#85
1168
+ def parse_boundary(content_type); end
1169
+ end
1170
+ end
1171
+
1172
+ # source://rack//lib/rack/multipart/parser.rb#47
1173
+ Rack::Multipart::Parser::BUFSIZE = T.let(T.unsafe(nil), Integer)
1174
+
1175
+ # source://rack//lib/rack/multipart/parser.rb#53
1176
+ class Rack::Multipart::Parser::BoundedIO
1177
+ # @return [BoundedIO] a new instance of BoundedIO
1178
+ #
1179
+ # source://rack//lib/rack/multipart/parser.rb#54
1180
+ def initialize(io, content_length); end
1181
+
1182
+ # source://rack//lib/rack/multipart/parser.rb#60
1183
+ def read(size, outbuf = T.unsafe(nil)); end
1184
+ end
1185
+
1186
+ # source://rack//lib/rack/multipart/parser.rb#398
1187
+ Rack::Multipart::Parser::CHARSET = T.let(T.unsafe(nil), String)
1188
+
1189
+ # source://rack//lib/rack/multipart/parser.rb#112
1190
+ class Rack::Multipart::Parser::Collector
1191
+ include ::Enumerable
1192
+
1193
+ # @return [Collector] a new instance of Collector
1194
+ #
1195
+ # source://rack//lib/rack/multipart/parser.rb#148
1196
+ def initialize(tempfile); end
1197
+
1198
+ # source://rack//lib/rack/multipart/parser.rb#154
1199
+ def each; end
1200
+
1201
+ # source://rack//lib/rack/multipart/parser.rb#174
1202
+ def on_mime_body(mime_index, content); end
1203
+
1204
+ # source://rack//lib/rack/multipart/parser.rb#178
1205
+ def on_mime_finish(mime_index); end
1206
+
1207
+ # source://rack//lib/rack/multipart/parser.rb#158
1208
+ def on_mime_head(mime_index, head, filename, content_type, name); end
1209
+
1210
+ private
1211
+
1212
+ # source://rack//lib/rack/multipart/parser.rb#183
1213
+ def check_part_limits; end
1214
+ end
1215
+
1216
+ # source://rack//lib/rack/multipart/parser.rb#136
1217
+ class Rack::Multipart::Parser::Collector::BufferPart < ::Rack::Multipart::Parser::Collector::MimePart
1218
+ # source://rack//lib/rack/multipart/parser.rb#138
1219
+ def close; end
1220
+
1221
+ # @return [Boolean]
1222
+ #
1223
+ # source://rack//lib/rack/multipart/parser.rb#137
1224
+ def file?; end
1225
+ end
1226
+
1227
+ # source://rack//lib/rack/multipart/parser.rb#113
1228
+ class Rack::Multipart::Parser::Collector::MimePart < ::Struct
1229
+ # @yield [data]
1230
+ #
1231
+ # source://rack//lib/rack/multipart/parser.rb#114
1232
+ def get_data; end
1233
+ end
1234
+
1235
+ # source://rack//lib/rack/multipart/parser.rb#141
1236
+ class Rack::Multipart::Parser::Collector::TempfilePart < ::Rack::Multipart::Parser::Collector::MimePart
1237
+ # source://rack//lib/rack/multipart/parser.rb#143
1238
+ def close; end
1239
+
1240
+ # @return [Boolean]
1241
+ #
1242
+ # source://rack//lib/rack/multipart/parser.rb#142
1243
+ def file?; end
1244
+ end
1245
+
1246
+ # source://rack//lib/rack/multipart/parser.rb#83
1247
+ Rack::Multipart::Parser::EMPTY = T.let(T.unsafe(nil), Rack::Multipart::Parser::MultipartInfo)
1248
+
1249
+ # source://rack//lib/rack/multipart/parser.rb#82
1250
+ class Rack::Multipart::Parser::MultipartInfo < ::Struct
1251
+ # Returns the value of attribute params
1252
+ #
1253
+ # @return [Object] the current value of params
1254
+ def params; end
1255
+
1256
+ # Sets the attribute params
1257
+ #
1258
+ # @param value [Object] the value to set the attribute params to.
1259
+ # @return [Object] the newly set value
1260
+ def params=(_); end
1261
+
1262
+ # Returns the value of attribute tmp_files
1263
+ #
1264
+ # @return [Object] the current value of tmp_files
1265
+ def tmp_files; end
1266
+
1267
+ # Sets the attribute tmp_files
1268
+ #
1269
+ # @param value [Object] the value to set the attribute tmp_files to.
1270
+ # @return [Object] the newly set value
1271
+ def tmp_files=(_); end
1272
+
1273
+ class << self
1274
+ def [](*_arg0); end
1275
+ def inspect; end
1276
+ def keyword_init?; end
1277
+ def members; end
1278
+ def new(*_arg0); end
1279
+ end
1280
+ end
1281
+
1282
+ # source://rack//lib/rack/multipart/parser.rb#49
1283
+ Rack::Multipart::Parser::TEMPFILE_FACTORY = T.let(T.unsafe(nil), Proc)
1284
+
1285
+ # source://rack//lib/rack/multipart/parser.rb#48
1286
+ Rack::Multipart::Parser::TEXT_PLAIN = T.let(T.unsafe(nil), String)
1287
+
1288
+ # source://rack//lib/rack/multipart/parser.rb#35
1289
+ Rack::Multipart::REGULAR_PARAMETER = T.let(T.unsafe(nil), Regexp)
1290
+
1291
+ # source://rack//lib/rack/multipart/parser.rb#34
1292
+ Rack::Multipart::REGULAR_PARAMETER_NAME = T.let(T.unsafe(nil), Regexp)
1293
+
1294
+ # source://rack//lib/rack/multipart/parser.rb#44
1295
+ Rack::Multipart::RFC2183 = T.let(T.unsafe(nil), Regexp)
1296
+
1297
+ # source://rack//lib/rack/multipart/parser.rb#33
1298
+ Rack::Multipart::SECTION = T.let(T.unsafe(nil), Regexp)
1299
+
1300
+ # source://rack//lib/rack/multipart/parser.rb#23
1301
+ Rack::Multipart::TOKEN = T.let(T.unsafe(nil), Regexp)
1302
+
1303
+ # source://rack//lib/rack/multipart/uploaded_file.rb#8
1304
+ class Rack::Multipart::UploadedFile
1305
+ # @return [UploadedFile] a new instance of UploadedFile
1306
+ #
1307
+ # source://rack//lib/rack/multipart/uploaded_file.rb#16
1308
+ 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
1309
+
1310
+ # The content type of the "uploaded" file
1311
+ #
1312
+ # source://rack//lib/rack/multipart/uploaded_file.rb#14
1313
+ def content_type; end
1314
+
1315
+ # The content type of the "uploaded" file
1316
+ #
1317
+ # source://rack//lib/rack/multipart/uploaded_file.rb#14
1318
+ def content_type=(_arg0); end
1319
+
1320
+ # source://rack//lib/rack/multipart/uploaded_file.rb#31
1321
+ def local_path; end
1322
+
1323
+ # source://rack//lib/rack/multipart/uploaded_file.rb#40
1324
+ def method_missing(method_name, *args, &block); end
1325
+
1326
+ # The filename, *not* including the path, of the "uploaded" file
1327
+ #
1328
+ # source://rack//lib/rack/multipart/uploaded_file.rb#11
1329
+ def original_filename; end
1330
+
1331
+ # source://rack//lib/rack/multipart/uploaded_file.rb#31
1332
+ def path; end
1333
+
1334
+ # @return [Boolean]
1335
+ #
1336
+ # source://rack//lib/rack/multipart/uploaded_file.rb#36
1337
+ def respond_to?(*args); end
1338
+ end
1339
+
1340
+ # source://rack//lib/rack/multipart/parser.rb#25
1341
+ Rack::Multipart::VALUE = T.let(T.unsafe(nil), Regexp)
1342
+
1343
+ # source://rack//lib/rack/constants.rb#34
1344
+ Rack::OPTIONS = T.let(T.unsafe(nil), String)
1345
+
1346
+ # source://rack//lib/rack/constants.rb#31
1347
+ Rack::PATCH = T.let(T.unsafe(nil), String)
1348
+
1349
+ # source://rack//lib/rack/constants.rb#8
1350
+ Rack::PATH_INFO = T.let(T.unsafe(nil), String)
1351
+
1352
+ # source://rack//lib/rack/constants.rb#29
1353
+ Rack::POST = T.let(T.unsafe(nil), String)
1354
+
1355
+ # source://rack//lib/rack/constants.rb#30
1356
+ Rack::PUT = T.let(T.unsafe(nil), String)
1357
+
1358
+ # source://rack//lib/rack/constants.rb#12
1359
+ Rack::QUERY_STRING = T.let(T.unsafe(nil), String)
1360
+
1361
+ # source://rack//lib/rack/query_parser.rb#6
1362
+ class Rack::QueryParser
1363
+ # @return [QueryParser] a new instance of QueryParser
1364
+ #
1365
+ # source://rack//lib/rack/query_parser.rb#33
1366
+ def initialize(params_class, _key_space_limit = T.unsafe(nil), param_depth_limit); end
1367
+
1368
+ # source://rack//lib/rack/query_parser.rb#167
1369
+ def make_params; end
1370
+
1371
+ # source://rack//lib/rack/query_parser.rb#171
1372
+ def new_depth_limit(param_depth_limit); end
1373
+
1374
+ # normalize_params recursively expands parameters into structural types. If
1375
+ # the structural types represented by two different parameter names are in
1376
+ # conflict, a ParameterTypeError is raised. The depth argument is deprecated
1377
+ # and should no longer be used, it is kept for backwards compatibility with
1378
+ # earlier versions of rack.
1379
+ #
1380
+ # source://rack//lib/rack/query_parser.rb#95
1381
+ def normalize_params(params, name, v, _depth = T.unsafe(nil)); end
1382
+
1383
+ # Returns the value of attribute param_depth_limit.
1384
+ #
1385
+ # source://rack//lib/rack/query_parser.rb#31
1386
+ def param_depth_limit; end
1387
+
1388
+ # parse_nested_query expands a query string into structural types. Supported
1389
+ # types are Arrays, Hashes and basic value types. It is possible to supply
1390
+ # query strings with parameters of conflicting types, in this case a
1391
+ # ParameterTypeError is raised. Users are encouraged to return a 400 in this
1392
+ # case.
1393
+ #
1394
+ # source://rack//lib/rack/query_parser.rb#74
1395
+ def parse_nested_query(qs, separator = T.unsafe(nil)); end
1396
+
1397
+ # Stolen from Mongrel, with some small modifications:
1398
+ # Parses a query string by breaking it up at the '&'. You can also use this
1399
+ # to parse cookies by changing the characters used in the second parameter
1400
+ # (which defaults to '&').
1401
+ #
1402
+ # source://rack//lib/rack/query_parser.rb#46
1403
+ def parse_query(qs, separator = T.unsafe(nil), &unescaper); end
1404
+
1405
+ private
1406
+
1407
+ # @raise [ParamsTooDeepError]
1408
+ #
1409
+ # source://rack//lib/rack/query_parser.rb#99
1410
+ def _normalize_params(params, name, v, depth); end
1411
+
1412
+ # @return [Boolean]
1413
+ #
1414
+ # source://rack//lib/rack/query_parser.rb#181
1415
+ def params_hash_has_key?(hash, key); end
1416
+
1417
+ # @return [Boolean]
1418
+ #
1419
+ # source://rack//lib/rack/query_parser.rb#177
1420
+ def params_hash_type?(obj); end
1421
+
1422
+ # source://rack//lib/rack/query_parser.rb#193
1423
+ def unescape(string, encoding = T.unsafe(nil)); end
1424
+
1425
+ class << self
1426
+ # source://rack//lib/rack/query_parser.rb#23
1427
+ def make_default(_key_space_limit = T.unsafe(nil), param_depth_limit); end
1428
+ end
1429
+ end
1430
+
1431
+ # source://rack//lib/rack/query_parser.rb#8
1432
+ Rack::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash)
1433
+
1434
+ # source://rack//lib/rack/query_parser.rb#7
1435
+ Rack::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
1436
+
1437
+ # InvalidParameterError is the error that is raised when incoming structural
1438
+ # parameters (parsed by parse_nested_query) contain invalid format or byte
1439
+ # sequence.
1440
+ #
1441
+ # source://rack//lib/rack/query_parser.rb#17
1442
+ class Rack::QueryParser::InvalidParameterError < ::ArgumentError; end
1443
+
1444
+ # ParameterTypeError is the error that is raised when incoming structural
1445
+ # parameters (parsed by parse_nested_query) contain conflicting types.
1446
+ #
1447
+ # source://rack//lib/rack/query_parser.rb#12
1448
+ class Rack::QueryParser::ParameterTypeError < ::TypeError; end
1449
+
1450
+ # source://rack//lib/rack/query_parser.rb#197
1451
+ class Rack::QueryParser::Params
1452
+ # @return [Params] a new instance of Params
1453
+ #
1454
+ # source://rack//lib/rack/query_parser.rb#198
1455
+ def initialize; end
1456
+
1457
+ # source://rack//lib/rack/query_parser.rb#203
1458
+ def [](key); end
1459
+
1460
+ # source://rack//lib/rack/query_parser.rb#207
1461
+ def []=(key, value); end
1462
+
1463
+ # @return [Boolean]
1464
+ #
1465
+ # source://rack//lib/rack/query_parser.rb#211
1466
+ def key?(key); end
1467
+
1468
+ # Recursively unwraps nested `Params` objects and constructs an object
1469
+ # of the same shape, but using the objects' internal representations
1470
+ # (Ruby hashes) in place of the objects. The result is a hash consisting
1471
+ # purely of Ruby primitives.
1472
+ #
1473
+ # Mutation warning!
1474
+ #
1475
+ # 1. This method mutates the internal representation of the `Params`
1476
+ # objects in order to save object allocations.
1477
+ #
1478
+ # 2. The value you get back is a reference to the internal hash
1479
+ # representation, not a copy.
1480
+ #
1481
+ # 3. Because the `Params` object's internal representation is mutable
1482
+ # through the `#[]=` method, it is not thread safe. The result of
1483
+ # getting the hash representation while another thread is adding a
1484
+ # key to it is non-deterministic.
1485
+ #
1486
+ # source://rack//lib/rack/query_parser.rb#233
1487
+ def to_h; end
1488
+
1489
+ # Recursively unwraps nested `Params` objects and constructs an object
1490
+ # of the same shape, but using the objects' internal representations
1491
+ # (Ruby hashes) in place of the objects. The result is a hash consisting
1492
+ # purely of Ruby primitives.
1493
+ #
1494
+ # Mutation warning!
1495
+ #
1496
+ # 1. This method mutates the internal representation of the `Params`
1497
+ # objects in order to save object allocations.
1498
+ #
1499
+ # 2. The value you get back is a reference to the internal hash
1500
+ # representation, not a copy.
1501
+ #
1502
+ # 3. Because the `Params` object's internal representation is mutable
1503
+ # through the `#[]=` method, it is not thread safe. The result of
1504
+ # getting the hash representation while another thread is adding a
1505
+ # key to it is non-deterministic.
1506
+ #
1507
+ # source://rack//lib/rack/query_parser.rb#233
1508
+ def to_params_hash; end
1509
+ end
1510
+
1511
+ # ParamsTooDeepError is the error that is raised when params are recursively
1512
+ # nested over the specified limit.
1513
+ #
1514
+ # source://rack//lib/rack/query_parser.rb#21
1515
+ class Rack::QueryParser::ParamsTooDeepError < ::RangeError; end
1516
+
1517
+ # source://rack//lib/rack/constants.rb#42
1518
+ Rack::RACK_ERRORS = T.let(T.unsafe(nil), String)
1519
+
1520
+ # source://rack//lib/rack/constants.rb#49
1521
+ Rack::RACK_HIJACK = T.let(T.unsafe(nil), String)
1522
+
1523
+ # source://rack//lib/rack/constants.rb#44
1524
+ Rack::RACK_INPUT = T.let(T.unsafe(nil), String)
1525
+
1526
+ # source://rack//lib/rack/constants.rb#50
1527
+ Rack::RACK_IS_HIJACK = T.let(T.unsafe(nil), String)
1528
+
1529
+ # source://rack//lib/rack/constants.rb#43
1530
+ Rack::RACK_LOGGER = T.let(T.unsafe(nil), String)
1531
+
1532
+ # source://rack//lib/rack/constants.rb#63
1533
+ Rack::RACK_METHODOVERRIDE_ORIGINAL_METHOD = T.let(T.unsafe(nil), String)
1534
+
1535
+ # source://rack//lib/rack/constants.rb#52
1536
+ Rack::RACK_MULTIPART_BUFFER_SIZE = T.let(T.unsafe(nil), String)
1537
+
1538
+ # source://rack//lib/rack/constants.rb#53
1539
+ Rack::RACK_MULTIPART_TEMPFILE_FACTORY = T.let(T.unsafe(nil), String)
1540
+
1541
+ # source://rack//lib/rack/constants.rb#51
1542
+ Rack::RACK_RECURSIVE_INCLUDE = T.let(T.unsafe(nil), String)
1543
+
1544
+ # source://rack//lib/rack/constants.rb#59
1545
+ Rack::RACK_REQUEST_COOKIE_HASH = T.let(T.unsafe(nil), String)
1546
+
1547
+ # source://rack//lib/rack/constants.rb#60
1548
+ Rack::RACK_REQUEST_COOKIE_STRING = T.let(T.unsafe(nil), String)
1549
+
1550
+ # source://rack//lib/rack/constants.rb#58
1551
+ Rack::RACK_REQUEST_FORM_ERROR = T.let(T.unsafe(nil), String)
1552
+
1553
+ # source://rack//lib/rack/constants.rb#56
1554
+ Rack::RACK_REQUEST_FORM_HASH = T.let(T.unsafe(nil), String)
1555
+
1556
+ # source://rack//lib/rack/constants.rb#55
1557
+ Rack::RACK_REQUEST_FORM_INPUT = T.let(T.unsafe(nil), String)
1558
+
1559
+ # source://rack//lib/rack/constants.rb#57
1560
+ Rack::RACK_REQUEST_FORM_VARS = T.let(T.unsafe(nil), String)
1561
+
1562
+ # source://rack//lib/rack/constants.rb#61
1563
+ Rack::RACK_REQUEST_QUERY_HASH = T.let(T.unsafe(nil), String)
1564
+
1565
+ # source://rack//lib/rack/constants.rb#62
1566
+ Rack::RACK_REQUEST_QUERY_STRING = T.let(T.unsafe(nil), String)
1567
+
1568
+ # source://rack//lib/rack/constants.rb#54
1569
+ Rack::RACK_RESPONSE_FINISHED = T.let(T.unsafe(nil), String)
1570
+
1571
+ # source://rack//lib/rack/constants.rb#45
1572
+ Rack::RACK_SESSION = T.let(T.unsafe(nil), String)
1573
+
1574
+ # source://rack//lib/rack/constants.rb#46
1575
+ Rack::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String)
1576
+
1577
+ # source://rack//lib/rack/constants.rb#47
1578
+ Rack::RACK_SHOWSTATUS_DETAIL = T.let(T.unsafe(nil), String)
1579
+
1580
+ # source://rack//lib/rack/constants.rb#41
1581
+ Rack::RACK_TEMPFILES = T.let(T.unsafe(nil), String)
1582
+
1583
+ # source://rack//lib/rack/constants.rb#48
1584
+ Rack::RACK_URL_SCHEME = T.let(T.unsafe(nil), String)
1585
+
1586
+ # Rack environment variables
1587
+ #
1588
+ # source://rack//lib/rack/constants.rb#40
1589
+ Rack::RACK_VERSION = T.let(T.unsafe(nil), String)
1590
+
1591
+ # source://rack//lib/rack/version.rb#28
1592
+ Rack::RELEASE = T.let(T.unsafe(nil), String)
1593
+
1594
+ # source://rack//lib/rack/constants.rb#9
1595
+ Rack::REQUEST_METHOD = T.let(T.unsafe(nil), String)
1596
+
1597
+ # source://rack//lib/rack/constants.rb#10
1598
+ Rack::REQUEST_PATH = T.let(T.unsafe(nil), String)
1599
+
1600
+ # Rack::Request provides a convenient interface to a Rack
1601
+ # environment. It is stateless, the environment +env+ passed to the
1602
+ # constructor will be directly modified.
1603
+ #
1604
+ # req = Rack::Request.new(env)
1605
+ # req.post?
1606
+ # req.params["data"]
1607
+ #
1608
+ # source://rack//lib/rack/request.rb#16
1609
+ class Rack::Request
1610
+ include ::Rack::Request::Env
1611
+ include ::Rack::Request::Helpers
1612
+
1613
+ # @return [Request] a new instance of Request
1614
+ #
1615
+ # source://rack//lib/rack/request.rb#62
1616
+ def initialize(env); end
1617
+
1618
+ # source://rack//lib/rack/request.rb#76
1619
+ def delete_param(k); end
1620
+
1621
+ # source://rack//lib/rack/request.rb#67
1622
+ def params; end
1623
+
1624
+ # source://rack//lib/rack/request.rb#67
1625
+ def query; end
1626
+
1627
+ # source://rack//lib/rack/request.rb#71
1628
+ def update_param(k, v); end
1629
+
1630
+ # source://yard/0.9.36/lib/yard/server/rack_adapter.rb#94
1631
+ def version_supplied; end
1632
+
1633
+ # source://yard/0.9.36/lib/yard/server/rack_adapter.rb#94
1634
+ def version_supplied=(_arg0); end
1635
+
1636
+ # source://yard/0.9.36/lib/yard/server/rack_adapter.rb#96
1637
+ def xhr?; end
1638
+
1639
+ class << self
1640
+ # The priority when checking forwarded headers. The default
1641
+ # is <tt>[:forwarded, :x_forwarded]</tt>, which means, check the
1642
+ # +Forwarded+ header first, followed by the appropriate
1643
+ # <tt>X-Forwarded-*</tt> header. You can revert the priority by
1644
+ # reversing the priority, or remove checking of either
1645
+ # or both headers by removing elements from the array.
1646
+ #
1647
+ # This should be set as appropriate in your environment
1648
+ # based on what reverse proxies are in use. If you are not
1649
+ # using reverse proxies, you should probably use an empty
1650
+ # array.
1651
+ #
1652
+ # source://rack//lib/rack/request.rb#31
1653
+ def forwarded_priority; end
1654
+
1655
+ # The priority when checking forwarded headers. The default
1656
+ # is <tt>[:forwarded, :x_forwarded]</tt>, which means, check the
1657
+ # +Forwarded+ header first, followed by the appropriate
1658
+ # <tt>X-Forwarded-*</tt> header. You can revert the priority by
1659
+ # reversing the priority, or remove checking of either
1660
+ # or both headers by removing elements from the array.
1661
+ #
1662
+ # This should be set as appropriate in your environment
1663
+ # based on what reverse proxies are in use. If you are not
1664
+ # using reverse proxies, you should probably use an empty
1665
+ # array.
1666
+ #
1667
+ # source://rack//lib/rack/request.rb#31
1668
+ def forwarded_priority=(_arg0); end
1669
+
1670
+ # Returns the value of attribute ip_filter.
1671
+ #
1672
+ # source://rack//lib/rack/request.rb#18
1673
+ def ip_filter; end
1674
+
1675
+ # Sets the attribute ip_filter
1676
+ #
1677
+ # @param value the value to set the attribute ip_filter to.
1678
+ #
1679
+ # source://rack//lib/rack/request.rb#18
1680
+ def ip_filter=(_arg0); end
1681
+
1682
+ # The priority when checking either the <tt>X-Forwarded-Proto</tt>
1683
+ # or <tt>X-Forwarded-Scheme</tt> header for the forwarded protocol.
1684
+ # The default is <tt>[:proto, :scheme]</tt>, to try the
1685
+ # <tt>X-Forwarded-Proto</tt> header before the
1686
+ # <tt>X-Forwarded-Scheme</tt> header. Rack 2 had behavior
1687
+ # similar to <tt>[:scheme, :proto]</tt>. You can remove either or
1688
+ # both of the entries in array to ignore that respective header.
1689
+ #
1690
+ # source://rack//lib/rack/request.rb#40
1691
+ def x_forwarded_proto_priority; end
1692
+
1693
+ # The priority when checking either the <tt>X-Forwarded-Proto</tt>
1694
+ # or <tt>X-Forwarded-Scheme</tt> header for the forwarded protocol.
1695
+ # The default is <tt>[:proto, :scheme]</tt>, to try the
1696
+ # <tt>X-Forwarded-Proto</tt> header before the
1697
+ # <tt>X-Forwarded-Scheme</tt> header. Rack 2 had behavior
1698
+ # similar to <tt>[:scheme, :proto]</tt>. You can remove either or
1699
+ # both of the entries in array to ignore that respective header.
1700
+ #
1701
+ # source://rack//lib/rack/request.rb#40
1702
+ def x_forwarded_proto_priority=(_arg0); end
1703
+ end
1704
+ end
1705
+
1706
+ # source://rack//lib/rack/request.rb#60
1707
+ Rack::Request::ALLOWED_SCHEMES = T.let(T.unsafe(nil), Array)
1708
+
1709
+ # source://rack//lib/rack/request.rb#82
1710
+ module Rack::Request::Env
1711
+ # source://rack//lib/rack/request.rb#86
1712
+ def initialize(env); end
1713
+
1714
+ # Add a header that may have multiple values.
1715
+ #
1716
+ # Example:
1717
+ # request.add_header 'Accept', 'image/png'
1718
+ # request.add_header 'Accept', '*/*'
1719
+ #
1720
+ # assert_equal 'image/png,*/*', request.get_header('Accept')
1721
+ #
1722
+ # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
1723
+ #
1724
+ # source://rack//lib/rack/request.rb#129
1725
+ def add_header(key, v); end
1726
+
1727
+ # Delete a request specific value for `name`.
1728
+ #
1729
+ # source://rack//lib/rack/request.rb#140
1730
+ def delete_header(name); end
1731
+
1732
+ # Loops through each key / value pair in the request specific data.
1733
+ #
1734
+ # source://rack//lib/rack/request.rb#111
1735
+ def each_header(&block); end
1736
+
1737
+ # The environment of the request.
1738
+ #
1739
+ # source://rack//lib/rack/request.rb#84
1740
+ def env; end
1741
+
1742
+ # If a block is given, it yields to the block if the value hasn't been set
1743
+ # on the request.
1744
+ #
1745
+ # source://rack//lib/rack/request.rb#106
1746
+ def fetch_header(name, &block); end
1747
+
1748
+ # Get a request specific value for `name`.
1749
+ #
1750
+ # source://rack//lib/rack/request.rb#100
1751
+ def get_header(name); end
1752
+
1753
+ # Predicate method to test to see if `name` has been set as request
1754
+ # specific data
1755
+ #
1756
+ # @return [Boolean]
1757
+ #
1758
+ # source://rack//lib/rack/request.rb#95
1759
+ def has_header?(name); end
1760
+
1761
+ # Set a request specific value for `name` to `v`
1762
+ #
1763
+ # source://rack//lib/rack/request.rb#116
1764
+ def set_header(name, v); end
1765
+
1766
+ private
1767
+
1768
+ # source://rack//lib/rack/request.rb#144
1769
+ def initialize_copy(other); end
1770
+ end
1771
+
1772
+ # source://rack//lib/rack/request.rb#149
1773
+ module Rack::Request::Helpers
1774
+ # Returns the data received in the query string.
1775
+ #
1776
+ # source://rack//lib/rack/request.rb#484
1777
+ def GET; end
1778
+
1779
+ # Returns the data received in the request body.
1780
+ #
1781
+ # This method support both application/x-www-form-urlencoded and
1782
+ # multipart/form-data.
1783
+ #
1784
+ # source://rack//lib/rack/request.rb#498
1785
+ def POST; end
1786
+
1787
+ # shortcut for <tt>request.params[key]</tt>
1788
+ #
1789
+ # source://rack//lib/rack/request.rb#609
1790
+ def [](key); end
1791
+
1792
+ # shortcut for <tt>request.params[key] = value</tt>
1793
+ #
1794
+ # Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params.
1795
+ #
1796
+ # source://rack//lib/rack/request.rb#618
1797
+ def []=(key, value); end
1798
+
1799
+ # source://rack//lib/rack/request.rb#596
1800
+ def accept_encoding; end
1801
+
1802
+ # source://rack//lib/rack/request.rb#600
1803
+ def accept_language; end
1804
+
1805
+ # The authority of the incoming request as defined by RFC3976.
1806
+ # https://tools.ietf.org/html/rfc3986#section-3.2
1807
+ #
1808
+ # In HTTP/1, this is the `host` header.
1809
+ # In HTTP/2, this is the `:authority` pseudo-header.
1810
+ #
1811
+ # source://rack//lib/rack/request.rb#266
1812
+ def authority; end
1813
+
1814
+ # source://rack//lib/rack/request.rb#579
1815
+ def base_url; end
1816
+
1817
+ # source://rack//lib/rack/request.rb#190
1818
+ def body; end
1819
+
1820
+ # The character set of the request body if a "charset" media type
1821
+ # parameter was given, or nil if no "charset" was specified. Note
1822
+ # that, per RFC2616, text/* media types that specify no explicit
1823
+ # charset are to be considered ISO-8859-1.
1824
+ #
1825
+ # source://rack//lib/rack/request.rb#458
1826
+ def content_charset; end
1827
+
1828
+ # source://rack//lib/rack/request.rb#199
1829
+ def content_length; end
1830
+
1831
+ # source://rack//lib/rack/request.rb#308
1832
+ def content_type; end
1833
+
1834
+ # source://rack//lib/rack/request.rb#293
1835
+ def cookies; end
1836
+
1837
+ # Checks the HTTP request method (or verb) to see if it was of type DELETE
1838
+ #
1839
+ # @return [Boolean]
1840
+ #
1841
+ # source://rack//lib/rack/request.rb#220
1842
+ def delete?; end
1843
+
1844
+ # Destructively delete a parameter, whether it's in GET or POST. Returns the value of the deleted parameter.
1845
+ #
1846
+ # If the parameter is in both GET and POST, the POST value takes precedence since that's how #params works.
1847
+ #
1848
+ # <tt>env['rack.input']</tt> is not touched.
1849
+ #
1850
+ # source://rack//lib/rack/request.rb#574
1851
+ def delete_param(k); end
1852
+
1853
+ # Determine whether the request body contains form-data by checking
1854
+ # the request content-type for one of the media-types:
1855
+ # "application/x-www-form-urlencoded" or "multipart/form-data". The
1856
+ # list of form-data media types can be modified through the
1857
+ # +FORM_DATA_MEDIA_TYPES+ array.
1858
+ #
1859
+ # A request body is also assumed to contain form-data when no
1860
+ # content-type header is provided and the request_method is POST.
1861
+ #
1862
+ # @return [Boolean]
1863
+ #
1864
+ # source://rack//lib/rack/request.rb#470
1865
+ def form_data?; end
1866
+
1867
+ # source://rack//lib/rack/request.rb#393
1868
+ def forwarded_authority; end
1869
+
1870
+ # source://rack//lib/rack/request.rb#353
1871
+ def forwarded_for; end
1872
+
1873
+ # source://rack//lib/rack/request.rb#374
1874
+ def forwarded_port; end
1875
+
1876
+ # source://rack//lib/rack/request.rb#592
1877
+ def fullpath; end
1878
+
1879
+ # Checks the HTTP request method (or verb) to see if it was of type GET
1880
+ #
1881
+ # @return [Boolean]
1882
+ #
1883
+ # source://rack//lib/rack/request.rb#223
1884
+ def get?; end
1885
+
1886
+ # Checks the HTTP request method (or verb) to see if it was of type HEAD
1887
+ #
1888
+ # @return [Boolean]
1889
+ #
1890
+ # source://rack//lib/rack/request.rb#226
1891
+ def head?; end
1892
+
1893
+ # Returns a formatted host, suitable for being used in a URI.
1894
+ #
1895
+ # source://rack//lib/rack/request.rb#333
1896
+ def host; end
1897
+
1898
+ # The `HTTP_HOST` header.
1899
+ #
1900
+ # source://rack//lib/rack/request.rb#318
1901
+ def host_authority; end
1902
+
1903
+ # source://rack//lib/rack/request.rb#322
1904
+ def host_with_port(authority = T.unsafe(nil)); end
1905
+
1906
+ # Returns an address suitable for being to resolve to an address.
1907
+ # In the case of a domain name or IPv4 address, the result is the same
1908
+ # as +host+. In the case of IPv6 or future address formats, the square
1909
+ # brackets are removed.
1910
+ #
1911
+ # source://rack//lib/rack/request.rb#341
1912
+ def hostname; end
1913
+
1914
+ # source://rack//lib/rack/request.rb#414
1915
+ def ip; end
1916
+
1917
+ # Checks the HTTP request method (or verb) to see if it was of type LINK
1918
+ #
1919
+ # @return [Boolean]
1920
+ #
1921
+ # source://rack//lib/rack/request.rb#232
1922
+ def link?; end
1923
+
1924
+ # source://rack//lib/rack/request.rb#200
1925
+ def logger; end
1926
+
1927
+ # The media type (type/subtype) portion of the CONTENT_TYPE header
1928
+ # without any media type parameters. e.g., when CONTENT_TYPE is
1929
+ # "text/plain;charset=utf-8", the media-type is "text/plain".
1930
+ #
1931
+ # For more information on the use of media types in HTTP, see:
1932
+ # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
1933
+ #
1934
+ # source://rack//lib/rack/request.rb#441
1935
+ def media_type; end
1936
+
1937
+ # The media type parameters provided in CONTENT_TYPE as a Hash, or
1938
+ # an empty Hash if no CONTENT_TYPE or media-type parameters were
1939
+ # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8",
1940
+ # this method responds with the following Hash:
1941
+ # { 'charset' => 'utf-8' }
1942
+ #
1943
+ # source://rack//lib/rack/request.rb#450
1944
+ def media_type_params; end
1945
+
1946
+ # Checks the HTTP request method (or verb) to see if it was of type OPTIONS
1947
+ #
1948
+ # @return [Boolean]
1949
+ #
1950
+ # source://rack//lib/rack/request.rb#229
1951
+ def options?; end
1952
+
1953
+ # The union of GET and POST data.
1954
+ #
1955
+ # Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params.
1956
+ #
1957
+ # source://rack//lib/rack/request.rb#545
1958
+ def params; end
1959
+
1960
+ # Determine whether the request body contains data by checking
1961
+ # the request media_type against registered parse-data media-types
1962
+ #
1963
+ # @return [Boolean]
1964
+ #
1965
+ # source://rack//lib/rack/request.rb#479
1966
+ def parseable_data?; end
1967
+
1968
+ # Checks the HTTP request method (or verb) to see if it was of type PATCH
1969
+ #
1970
+ # @return [Boolean]
1971
+ #
1972
+ # source://rack//lib/rack/request.rb#235
1973
+ def patch?; end
1974
+
1975
+ # source://rack//lib/rack/request.rb#588
1976
+ def path; end
1977
+
1978
+ # source://rack//lib/rack/request.rb#194
1979
+ def path_info; end
1980
+
1981
+ # source://rack//lib/rack/request.rb#195
1982
+ def path_info=(s); end
1983
+
1984
+ # source://rack//lib/rack/request.rb#345
1985
+ def port; end
1986
+
1987
+ # Checks the HTTP request method (or verb) to see if it was of type POST
1988
+ #
1989
+ # @return [Boolean]
1990
+ #
1991
+ # source://rack//lib/rack/request.rb#238
1992
+ def post?; end
1993
+
1994
+ # Checks the HTTP request method (or verb) to see if it was of type PUT
1995
+ #
1996
+ # @return [Boolean]
1997
+ #
1998
+ # source://rack//lib/rack/request.rb#241
1999
+ def put?; end
2000
+
2001
+ # source://rack//lib/rack/request.rb#198
2002
+ def query_string; end
2003
+
2004
+ # the referer of the client
2005
+ #
2006
+ # source://rack//lib/rack/request.rb#204
2007
+ def referer; end
2008
+
2009
+ # the referer of the client
2010
+ #
2011
+ # source://rack//lib/rack/request.rb#204
2012
+ def referrer; end
2013
+
2014
+ # source://rack//lib/rack/request.rb#197
2015
+ def request_method; end
2016
+
2017
+ # source://rack//lib/rack/request.rb#249
2018
+ def scheme; end
2019
+
2020
+ # source://rack//lib/rack/request.rb#191
2021
+ def script_name; end
2022
+
2023
+ # source://rack//lib/rack/request.rb#192
2024
+ def script_name=(s); end
2025
+
2026
+ # The authority as defined by the `SERVER_NAME` and `SERVER_PORT`
2027
+ # variables.
2028
+ #
2029
+ # source://rack//lib/rack/request.rb#272
2030
+ def server_authority; end
2031
+
2032
+ # source://rack//lib/rack/request.rb#285
2033
+ def server_name; end
2034
+
2035
+ # source://rack//lib/rack/request.rb#289
2036
+ def server_port; end
2037
+
2038
+ # source://rack//lib/rack/request.rb#207
2039
+ def session; end
2040
+
2041
+ # source://rack//lib/rack/request.rb#213
2042
+ def session_options; end
2043
+
2044
+ # @return [Boolean]
2045
+ #
2046
+ # source://rack//lib/rack/request.rb#410
2047
+ def ssl?; end
2048
+
2049
+ # Checks the HTTP request method (or verb) to see if it was of type TRACE
2050
+ #
2051
+ # @return [Boolean]
2052
+ #
2053
+ # source://rack//lib/rack/request.rb#244
2054
+ def trace?; end
2055
+
2056
+ # @return [Boolean]
2057
+ #
2058
+ # source://rack//lib/rack/request.rb#604
2059
+ def trusted_proxy?(ip); end
2060
+
2061
+ # Checks the HTTP request method (or verb) to see if it was of type UNLINK
2062
+ #
2063
+ # @return [Boolean]
2064
+ #
2065
+ # source://rack//lib/rack/request.rb#247
2066
+ def unlink?; end
2067
+
2068
+ # Destructively update a parameter, whether it's in GET and/or POST. Returns nil.
2069
+ #
2070
+ # 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.
2071
+ #
2072
+ # <tt>env['rack.input']</tt> is not touched.
2073
+ #
2074
+ # source://rack//lib/rack/request.rb#554
2075
+ def update_param(k, v); end
2076
+
2077
+ # Tries to return a remake of the original request URL as a string.
2078
+ #
2079
+ # source://rack//lib/rack/request.rb#584
2080
+ def url; end
2081
+
2082
+ # source://rack//lib/rack/request.rb#201
2083
+ def user_agent; end
2084
+
2085
+ # like Hash#values_at
2086
+ #
2087
+ # source://rack//lib/rack/request.rb#625
2088
+ def values_at(*keys); end
2089
+
2090
+ # @return [Boolean]
2091
+ #
2092
+ # source://rack//lib/rack/request.rb#313
2093
+ def xhr?; end
2094
+
2095
+ private
2096
+
2097
+ # source://rack//lib/rack/request.rb#757
2098
+ def allowed_scheme(header); end
2099
+
2100
+ # source://rack//lib/rack/request.rb#631
2101
+ def default_session; end
2102
+
2103
+ # source://rack//lib/rack/request.rb#761
2104
+ def forwarded_priority; end
2105
+
2106
+ # source://rack//lib/rack/request.rb#733
2107
+ def forwarded_scheme; end
2108
+
2109
+ # Get an array of values set in the RFC 7239 `Forwarded` request header.
2110
+ #
2111
+ # source://rack//lib/rack/request.rb#659
2112
+ def get_http_forwarded(token); end
2113
+
2114
+ # source://rack//lib/rack/request.rb#647
2115
+ def parse_http_accept_header(header); end
2116
+
2117
+ # source://rack//lib/rack/request.rb#671
2118
+ def parse_multipart; end
2119
+
2120
+ # source://rack//lib/rack/request.rb#667
2121
+ def parse_query(qs, d = T.unsafe(nil)); end
2122
+
2123
+ # source://rack//lib/rack/request.rb#663
2124
+ def query_parser; end
2125
+
2126
+ # source://rack//lib/rack/request.rb#724
2127
+ def reject_trusted_ip_addresses(ip_addresses); end
2128
+
2129
+ # source://rack//lib/rack/request.rb#718
2130
+ def split_authority(authority); end
2131
+
2132
+ # source://rack//lib/rack/request.rb#675
2133
+ def split_header(value); end
2134
+
2135
+ # Assist with compatibility when processing `X-Forwarded-For`.
2136
+ #
2137
+ # source://rack//lib/rack/request.rb#634
2138
+ def wrap_ipv6(host); end
2139
+
2140
+ # source://rack//lib/rack/request.rb#765
2141
+ def x_forwarded_proto_priority; end
2142
+ end
2143
+
2144
+ # source://rack//lib/rack/request.rb#703
2145
+ Rack::Request::Helpers::AUTHORITY = T.let(T.unsafe(nil), Regexp)
2146
+
2147
+ # Default ports depending on scheme. Used to decide whether or not
2148
+ # to include the port in a generated URI.
2149
+ #
2150
+ # source://rack//lib/rack/request.rb#168
2151
+ Rack::Request::Helpers::DEFAULT_PORTS = T.let(T.unsafe(nil), Hash)
2152
+
2153
+ # The set of form-data media-types. Requests that do not indicate
2154
+ # one of the media types present in this list will not be eligible
2155
+ # for form-data / param parsing.
2156
+ #
2157
+ # source://rack//lib/rack/request.rb#153
2158
+ Rack::Request::Helpers::FORM_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array)
2159
+
2160
+ # source://rack//lib/rack/request.rb#728
2161
+ Rack::Request::Helpers::FORWARDED_SCHEME_HEADERS = T.let(T.unsafe(nil), Hash)
2162
+
2163
+ # source://rack//lib/rack/request.rb#176
2164
+ Rack::Request::Helpers::HTTP_FORWARDED = T.let(T.unsafe(nil), String)
2165
+
2166
+ # The address of the client which connected to the proxy.
2167
+ #
2168
+ # source://rack//lib/rack/request.rb#171
2169
+ Rack::Request::Helpers::HTTP_X_FORWARDED_FOR = T.let(T.unsafe(nil), String)
2170
+
2171
+ # The contents of the host/:authority header sent to the proxy.
2172
+ #
2173
+ # source://rack//lib/rack/request.rb#174
2174
+ Rack::Request::Helpers::HTTP_X_FORWARDED_HOST = T.let(T.unsafe(nil), String)
2175
+
2176
+ # The port used to connect to the proxy.
2177
+ #
2178
+ # source://rack//lib/rack/request.rb#185
2179
+ Rack::Request::Helpers::HTTP_X_FORWARDED_PORT = T.let(T.unsafe(nil), String)
2180
+
2181
+ # The protocol used to connect to the proxy.
2182
+ #
2183
+ # source://rack//lib/rack/request.rb#182
2184
+ Rack::Request::Helpers::HTTP_X_FORWARDED_PROTO = T.let(T.unsafe(nil), String)
2185
+
2186
+ # The value of the scheme sent to the proxy.
2187
+ #
2188
+ # source://rack//lib/rack/request.rb#179
2189
+ Rack::Request::Helpers::HTTP_X_FORWARDED_SCHEME = T.let(T.unsafe(nil), String)
2190
+
2191
+ # Another way for specifying https scheme was used.
2192
+ #
2193
+ # source://rack//lib/rack/request.rb#188
2194
+ Rack::Request::Helpers::HTTP_X_FORWARDED_SSL = T.let(T.unsafe(nil), String)
2195
+
2196
+ # The set of media-types. Requests that do not indicate
2197
+ # one of the media types present in this list will not be eligible
2198
+ # for param parsing like soap attachments or generic multiparts
2199
+ #
2200
+ # source://rack//lib/rack/request.rb#161
2201
+ Rack::Request::Helpers::PARSEABLE_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array)
2202
+
2203
+ # source://rack//lib/rack/constants.rb#11
2204
+ Rack::SCRIPT_NAME = T.let(T.unsafe(nil), String)
2205
+
2206
+ # source://rack//lib/rack/constants.rb#14
2207
+ Rack::SERVER_NAME = T.let(T.unsafe(nil), String)
2208
+
2209
+ # source://rack//lib/rack/constants.rb#15
2210
+ Rack::SERVER_PORT = T.let(T.unsafe(nil), String)
2211
+
2212
+ # source://rack//lib/rack/constants.rb#13
2213
+ Rack::SERVER_PROTOCOL = T.let(T.unsafe(nil), String)
2214
+
2215
+ # source://rack//lib/rack/constants.rb#24
2216
+ Rack::SET_COOKIE = T.let(T.unsafe(nil), String)
2217
+
2218
+ # Rack::ShowExceptions catches all exceptions raised from the app it
2219
+ # wraps. It shows a useful backtrace with the sourcefile and
2220
+ # clickable context, the whole Rack environment and the request
2221
+ # data.
2222
+ #
2223
+ # Be careful when you use this on public-facing sites as it could
2224
+ # reveal information helpful to attackers.
2225
+ #
2226
+ # source://rack//lib/rack/show_exceptions.rb#19
2227
+ class Rack::ShowExceptions
2228
+ # @return [ShowExceptions] a new instance of ShowExceptions
2229
+ #
2230
+ # source://rack//lib/rack/show_exceptions.rb#22
2231
+ def initialize(app); end
2232
+
2233
+ # source://rack//lib/rack/show_exceptions.rb#26
2234
+ def call(env); end
2235
+
2236
+ # source://rack//lib/rack/show_exceptions.rb#61
2237
+ def dump_exception(exception); end
2238
+
2239
+ # source://rack//lib/rack/show_exceptions.rb#112
2240
+ def h(obj); end
2241
+
2242
+ # @return [Boolean]
2243
+ #
2244
+ # source://rack//lib/rack/show_exceptions.rb#52
2245
+ def prefers_plaintext?(env); end
2246
+
2247
+ # source://rack//lib/rack/show_exceptions.rb#72
2248
+ def pretty(env, exception); end
2249
+
2250
+ # source://rack//lib/rack/show_exceptions.rb#108
2251
+ def template; end
2252
+
2253
+ private
2254
+
2255
+ # @return [Boolean]
2256
+ #
2257
+ # source://rack//lib/rack/show_exceptions.rb#56
2258
+ def accepts_html?(env); end
2259
+ end
2260
+
2261
+ # source://rack//lib/rack/show_exceptions.rb#20
2262
+ Rack::ShowExceptions::CONTEXT = T.let(T.unsafe(nil), Integer)
2263
+
2264
+ # source://rack//lib/rack/show_exceptions.rb#127
2265
+ Rack::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB)
2266
+
2267
+ # source://rack//lib/rack/constants.rb#37
2268
+ Rack::TRACE = T.let(T.unsafe(nil), String)
2269
+
2270
+ # source://rack//lib/rack/constants.rb#25
2271
+ Rack::TRANSFER_ENCODING = T.let(T.unsafe(nil), String)
2272
+
2273
+ # Middleware tracks and cleans Tempfiles created throughout a request (i.e. Rack::Multipart)
2274
+ # Ideas/strategy based on posts by Eric Wong and Charles Oliver Nutter
2275
+ # https://groups.google.com/forum/#!searchin/rack-devel/temp/rack-devel/brK8eh-MByw/sw61oJJCGRMJ
2276
+ #
2277
+ # source://rack//lib/rack/tempfile_reaper.rb#11
2278
+ class Rack::TempfileReaper
2279
+ # @return [TempfileReaper] a new instance of TempfileReaper
2280
+ #
2281
+ # source://rack//lib/rack/tempfile_reaper.rb#12
2282
+ def initialize(app); end
2283
+
2284
+ # source://rack//lib/rack/tempfile_reaper.rb#16
2285
+ def call(env); end
2286
+ end
2287
+
2288
+ # source://rack//lib/rack/constants.rb#36
2289
+ Rack::UNLINK = T.let(T.unsafe(nil), String)
2290
+
2291
+ # Rack::URLMap takes a hash mapping urls or paths to apps, and
2292
+ # dispatches accordingly. Support for HTTP/1.1 host names exists if
2293
+ # the URLs start with <tt>http://</tt> or <tt>https://</tt>.
2294
+ #
2295
+ # URLMap modifies the SCRIPT_NAME and PATH_INFO such that the part
2296
+ # relevant for dispatch is in the SCRIPT_NAME, and the rest in the
2297
+ # PATH_INFO. This should be taken care of when you need to
2298
+ # reconstruct the URL in order to create links.
2299
+ #
2300
+ # URLMap dispatches in such a way that the longest paths are tried
2301
+ # first, since they are most specific.
2302
+ #
2303
+ # source://rack//lib/rack/urlmap.rb#20
2304
+ class Rack::URLMap
2305
+ # @return [URLMap] a new instance of URLMap
2306
+ #
2307
+ # source://rack//lib/rack/urlmap.rb#21
2308
+ def initialize(map = T.unsafe(nil)); end
2309
+
2310
+ # source://rack//lib/rack/urlmap.rb#48
2311
+ def call(env); end
2312
+
2313
+ # source://rack//lib/rack/urlmap.rb#25
2314
+ def remap(map); end
2315
+
2316
+ private
2317
+
2318
+ # @return [Boolean]
2319
+ #
2320
+ # source://rack//lib/rack/urlmap.rb#87
2321
+ def casecmp?(v1, v2); end
2322
+ end
2323
+
2324
+ # Rack::Utils contains a grab-bag of useful methods for writing web
2325
+ # applications adopted from all kinds of Ruby libraries.
2326
+ #
2327
+ # source://rack//lib/rack/utils.rb#19
2328
+ module Rack::Utils
2329
+ private
2330
+
2331
+ # source://rack//lib/rack/utils.rb#255
2332
+ def add_cookie_to_header(header, key, value); end
2333
+
2334
+ # source://rack//lib/rack/utils.rb#390
2335
+ def add_remove_cookie_to_header(header, key, value = T.unsafe(nil)); end
2336
+
2337
+ # Return best accept value to use, based on the algorithm
2338
+ # in RFC 2616 Section 14. If there are multiple best
2339
+ # matches (same specificity and quality), the value returned
2340
+ # is arbitrary.
2341
+ #
2342
+ # source://rack//lib/rack/utils.rb#174
2343
+ def best_q_match(q_value_header, available_mimes); end
2344
+
2345
+ # source://rack//lib/rack/utils.rb#127
2346
+ def build_nested_query(value, prefix = T.unsafe(nil)); end
2347
+
2348
+ # source://rack//lib/rack/utils.rb#117
2349
+ def build_query(params); end
2350
+
2351
+ # Parses the "Range:" header, if present, into an array of Range objects.
2352
+ # Returns nil if the header is missing or syntactically invalid.
2353
+ # Returns an empty array if none of the ranges are satisfiable.
2354
+ #
2355
+ # source://rack//lib/rack/utils.rb#432
2356
+ def byte_ranges(env, size); end
2357
+
2358
+ # source://rack//lib/rack/utils.rb#636
2359
+ def clean_path_info(path_info); end
2360
+
2361
+ # :nocov:
2362
+ #
2363
+ # source://rack//lib/rack/utils.rb#98
2364
+ def clock_time; end
2365
+
2366
+ # source://rack//lib/rack/utils.rb#384
2367
+ def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end
2368
+
2369
+ # :call-seq:
2370
+ # delete_set_cookie_header(key, value = {}) -> encoded string
2371
+ #
2372
+ # Generate an encoded string based on the given +key+ and +value+ using
2373
+ # set_cookie_header for the purpose of causing the specified cookie to be
2374
+ # deleted. The +value+ may be an instance of +Hash+ and can include
2375
+ # attributes as outlined by set_cookie_header. The encoded cookie will have
2376
+ # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty
2377
+ # +value+. When used with the +set-cookie+ header, it will cause the client
2378
+ # to *remove* any matching cookie.
2379
+ #
2380
+ # delete_set_cookie_header("myname")
2381
+ # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
2382
+ #
2383
+ # source://rack//lib/rack/utils.rb#374
2384
+ def delete_set_cookie_header(key, value = T.unsafe(nil)); end
2385
+
2386
+ # :call-seq:
2387
+ # delete_set_cookie_header!(header, key, value = {}) -> header value
2388
+ #
2389
+ # Set an expired cookie in the specified headers with the given cookie
2390
+ # +key+ and +value+ using delete_set_cookie_header. This causes
2391
+ # the client to immediately delete the specified cookie.
2392
+ #
2393
+ # delete_set_cookie_header!(nil, "mycookie")
2394
+ # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
2395
+ #
2396
+ # If the header is non-nil, it will be modified in place.
2397
+ #
2398
+ # header = []
2399
+ # delete_set_cookie_header!(header, "mycookie")
2400
+ # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
2401
+ # header
2402
+ # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
2403
+ #
2404
+ # source://rack//lib/rack/utils.rb#414
2405
+ def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end
2406
+
2407
+ # URI escapes. (CGI style space to +)
2408
+ #
2409
+ # source://rack//lib/rack/utils.rb#38
2410
+ def escape(s); end
2411
+
2412
+ # Escape ampersands, brackets and quotes to their HTML/XML entities.
2413
+ #
2414
+ # source://rack//lib/rack/utils.rb#199
2415
+ def escape_html(string); end
2416
+
2417
+ # Like URI escaping, but with %20 instead of +. Strictly speaking this is
2418
+ # true URI escaping.
2419
+ #
2420
+ # source://rack//lib/rack/utils.rb#44
2421
+ def escape_path(s); end
2422
+
2423
+ # source://rack//lib/rack/utils.rb#156
2424
+ def forwarded_values(forwarded_header); end
2425
+
2426
+ # source://rack//lib/rack/utils.rb#436
2427
+ def get_byte_ranges(http_range, size); end
2428
+
2429
+ # source://rack//lib/rack/utils.rb#378
2430
+ def make_delete_cookie_header(header, key, value); end
2431
+
2432
+ # :call-seq:
2433
+ # parse_cookies(env) -> hash
2434
+ #
2435
+ # Parse cookies from the provided request environment using
2436
+ # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+.
2437
+ #
2438
+ # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'})
2439
+ # # => {'myname' => 'myvalue'}
2440
+ #
2441
+ # source://rack//lib/rack/utils.rb#279
2442
+ def parse_cookies(env); end
2443
+
2444
+ # :call-seq:
2445
+ # parse_cookies_header(value) -> hash
2446
+ #
2447
+ # Parse cookies from the provided header +value+ according to RFC6265. The
2448
+ # syntax for cookie headers only supports semicolons. Returns a map of
2449
+ # cookie +key+ to cookie +value+.
2450
+ #
2451
+ # parse_cookies_header('myname=myvalue; max-age=0')
2452
+ # # => {"myname"=>"myvalue", "max-age"=>"0"}
2453
+ #
2454
+ # source://rack//lib/rack/utils.rb#245
2455
+ def parse_cookies_header(value); end
2456
+
2457
+ # source://rack//lib/rack/utils.rb#113
2458
+ def parse_nested_query(qs, d = T.unsafe(nil)); end
2459
+
2460
+ # source://rack//lib/rack/utils.rb#109
2461
+ def parse_query(qs, d = T.unsafe(nil), &unescaper); end
2462
+
2463
+ # source://rack//lib/rack/utils.rb#145
2464
+ def q_values(q_value_header); end
2465
+
2466
+ # source://rack//lib/rack/utils.rb#425
2467
+ def rfc2822(time); end
2468
+
2469
+ # :nocov:
2470
+ #
2471
+ # source://rack//lib/rack/utils.rb#476
2472
+ def secure_compare(a, b); end
2473
+
2474
+ # source://rack//lib/rack/utils.rb#203
2475
+ def select_best_encoding(available_encodings, accept_encoding); end
2476
+
2477
+ # :call-seq:
2478
+ # set_cookie_header(key, value) -> encoded string
2479
+ #
2480
+ # Generate an encoded string using the provided +key+ and +value+ suitable
2481
+ # for the +set-cookie+ header according to RFC6265. The +value+ may be an
2482
+ # instance of either +String+ or +Hash+.
2483
+ #
2484
+ # If the cookie +value+ is an instance of +Hash+, it considers the following
2485
+ # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance
2486
+ # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more
2487
+ # details about the interpretation of these fields, consult
2488
+ # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2).
2489
+ #
2490
+ # An extra cookie attribute +escape_key+ can be provided to control whether
2491
+ # or not the cookie key is URL encoded. If explicitly set to +false+, the
2492
+ # cookie key name will not be url encoded (escaped). The default is +true+.
2493
+ #
2494
+ # set_cookie_header("myname", "myvalue")
2495
+ # # => "myname=myvalue"
2496
+ #
2497
+ # set_cookie_header("myname", {value: "myvalue", max_age: 10})
2498
+ # # => "myname=myvalue; max-age=10"
2499
+ #
2500
+ # source://rack//lib/rack/utils.rb#306
2501
+ def set_cookie_header(key, value); end
2502
+
2503
+ # :call-seq:
2504
+ # set_cookie_header!(headers, key, value) -> header value
2505
+ #
2506
+ # Append a cookie in the specified headers with the given cookie +key+ and
2507
+ # +value+ using set_cookie_header.
2508
+ #
2509
+ # If the headers already contains a +set-cookie+ key, it will be converted
2510
+ # to an +Array+ if not already, and appended to.
2511
+ #
2512
+ # source://rack//lib/rack/utils.rb#348
2513
+ def set_cookie_header!(headers, key, value); end
2514
+
2515
+ # source://rack//lib/rack/utils.rb#626
2516
+ def status_code(status); end
2517
+
2518
+ # Unescapes a URI escaped string with +encoding+. +encoding+ will be the
2519
+ # target encoding of the string returned, and it defaults to UTF-8
2520
+ #
2521
+ # source://rack//lib/rack/utils.rb#56
2522
+ def unescape(s, encoding = T.unsafe(nil)); end
2523
+
2524
+ # Unescapes the **path** component of a URI. See Rack::Utils.unescape for
2525
+ # unescaping query parameters or form components.
2526
+ #
2527
+ # source://rack//lib/rack/utils.rb#50
2528
+ def unescape_path(s); end
2529
+
2530
+ # source://rack//lib/rack/utils.rb#653
2531
+ def valid_path?(path); end
2532
+
2533
+ class << self
2534
+ # source://rack//lib/rack/utils.rb#255
2535
+ def add_cookie_to_header(header, key, value); end
2536
+
2537
+ # source://rack//lib/rack/utils.rb#390
2538
+ def add_remove_cookie_to_header(header, key, value = T.unsafe(nil)); end
2539
+
2540
+ # Return best accept value to use, based on the algorithm
2541
+ # in RFC 2616 Section 14. If there are multiple best
2542
+ # matches (same specificity and quality), the value returned
2543
+ # is arbitrary.
2544
+ #
2545
+ # source://rack//lib/rack/utils.rb#174
2546
+ def best_q_match(q_value_header, available_mimes); end
2547
+
2548
+ # source://rack//lib/rack/utils.rb#127
2549
+ def build_nested_query(value, prefix = T.unsafe(nil)); end
2550
+
2551
+ # source://rack//lib/rack/utils.rb#117
2552
+ def build_query(params); end
2553
+
2554
+ # Parses the "Range:" header, if present, into an array of Range objects.
2555
+ # Returns nil if the header is missing or syntactically invalid.
2556
+ # Returns an empty array if none of the ranges are satisfiable.
2557
+ #
2558
+ # source://rack//lib/rack/utils.rb#432
2559
+ def byte_ranges(env, size); end
2560
+
2561
+ # source://rack//lib/rack/utils.rb#636
2562
+ def clean_path_info(path_info); end
2563
+
2564
+ # source://rack//lib/rack/utils.rb#98
2565
+ def clock_time; end
2566
+
2567
+ # Returns the value of attribute default_query_parser.
2568
+ #
2569
+ # source://rack//lib/rack/utils.rb#28
2570
+ def default_query_parser; end
2571
+
2572
+ # Sets the attribute default_query_parser
2573
+ #
2574
+ # @param value the value to set the attribute default_query_parser to.
2575
+ #
2576
+ # source://rack//lib/rack/utils.rb#28
2577
+ def default_query_parser=(_arg0); end
2578
+
2579
+ # source://rack//lib/rack/utils.rb#384
2580
+ def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end
2581
+
2582
+ # :call-seq:
2583
+ # delete_set_cookie_header(key, value = {}) -> encoded string
2584
+ #
2585
+ # Generate an encoded string based on the given +key+ and +value+ using
2586
+ # set_cookie_header for the purpose of causing the specified cookie to be
2587
+ # deleted. The +value+ may be an instance of +Hash+ and can include
2588
+ # attributes as outlined by set_cookie_header. The encoded cookie will have
2589
+ # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty
2590
+ # +value+. When used with the +set-cookie+ header, it will cause the client
2591
+ # to *remove* any matching cookie.
2592
+ #
2593
+ # delete_set_cookie_header("myname")
2594
+ # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
2595
+ #
2596
+ # source://rack//lib/rack/utils.rb#374
2597
+ def delete_set_cookie_header(key, value = T.unsafe(nil)); end
2598
+
2599
+ # :call-seq:
2600
+ # delete_set_cookie_header!(header, key, value = {}) -> header value
2601
+ #
2602
+ # Set an expired cookie in the specified headers with the given cookie
2603
+ # +key+ and +value+ using delete_set_cookie_header. This causes
2604
+ # the client to immediately delete the specified cookie.
2605
+ #
2606
+ # delete_set_cookie_header!(nil, "mycookie")
2607
+ # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
2608
+ #
2609
+ # If the header is non-nil, it will be modified in place.
2610
+ #
2611
+ # header = []
2612
+ # delete_set_cookie_header!(header, "mycookie")
2613
+ # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
2614
+ # header
2615
+ # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
2616
+ #
2617
+ # source://rack//lib/rack/utils.rb#414
2618
+ def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end
2619
+
2620
+ # URI escapes. (CGI style space to +)
2621
+ #
2622
+ # source://rack//lib/rack/utils.rb#38
2623
+ def escape(s); end
2624
+
2625
+ # Escape ampersands, brackets and quotes to their HTML/XML entities.
2626
+ #
2627
+ # source://rack//lib/rack/utils.rb#199
2628
+ def escape_html(string); end
2629
+
2630
+ # Like URI escaping, but with %20 instead of +. Strictly speaking this is
2631
+ # true URI escaping.
2632
+ #
2633
+ # source://rack//lib/rack/utils.rb#44
2634
+ def escape_path(s); end
2635
+
2636
+ # source://rack//lib/rack/utils.rb#156
2637
+ def forwarded_values(forwarded_header); end
2638
+
2639
+ # source://rack//lib/rack/utils.rb#436
2640
+ def get_byte_ranges(http_range, size); end
2641
+
2642
+ # source://rack//lib/rack/utils.rb#88
2643
+ def key_space_limit; end
2644
+
2645
+ # source://rack//lib/rack/utils.rb#93
2646
+ def key_space_limit=(v); end
2647
+
2648
+ # source://rack//lib/rack/utils.rb#378
2649
+ def make_delete_cookie_header(header, key, value); end
2650
+
2651
+ # Returns the value of attribute multipart_file_limit.
2652
+ #
2653
+ # source://rack//lib/rack/utils.rb#63
2654
+ def multipart_file_limit; end
2655
+
2656
+ # Sets the attribute multipart_file_limit
2657
+ #
2658
+ # @param value the value to set the attribute multipart_file_limit to.
2659
+ #
2660
+ # source://rack//lib/rack/utils.rb#63
2661
+ def multipart_file_limit=(_arg0); end
2662
+
2663
+ # Returns the value of attribute multipart_file_limit.
2664
+ # multipart_part_limit is the original name of multipart_file_limit, but
2665
+ # the limit only counts parts with filenames.
2666
+ #
2667
+ # source://rack//lib/rack/utils.rb#63
2668
+ def multipart_part_limit; end
2669
+
2670
+ # Sets the attribute multipart_file_limit
2671
+ #
2672
+ # @param value the value to set the attribute multipart_file_limit to.
2673
+ #
2674
+ # source://rack//lib/rack/utils.rb#63
2675
+ def multipart_part_limit=(_arg0); end
2676
+
2677
+ # Returns the value of attribute multipart_total_part_limit.
2678
+ #
2679
+ # source://rack//lib/rack/utils.rb#61
2680
+ def multipart_total_part_limit; end
2681
+
2682
+ # Sets the attribute multipart_total_part_limit
2683
+ #
2684
+ # @param value the value to set the attribute multipart_total_part_limit to.
2685
+ #
2686
+ # source://rack//lib/rack/utils.rb#61
2687
+ def multipart_total_part_limit=(_arg0); end
2688
+
2689
+ # source://rack//lib/rack/utils.rb#80
2690
+ def param_depth_limit; end
2691
+
2692
+ # source://rack//lib/rack/utils.rb#84
2693
+ def param_depth_limit=(v); end
2694
+
2695
+ # :call-seq:
2696
+ # parse_cookies(env) -> hash
2697
+ #
2698
+ # Parse cookies from the provided request environment using
2699
+ # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+.
2700
+ #
2701
+ # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'})
2702
+ # # => {'myname' => 'myvalue'}
2703
+ #
2704
+ # source://rack//lib/rack/utils.rb#279
2705
+ def parse_cookies(env); end
2706
+
2707
+ # :call-seq:
2708
+ # parse_cookies_header(value) -> hash
2709
+ #
2710
+ # Parse cookies from the provided header +value+ according to RFC6265. The
2711
+ # syntax for cookie headers only supports semicolons. Returns a map of
2712
+ # cookie +key+ to cookie +value+.
2713
+ #
2714
+ # parse_cookies_header('myname=myvalue; max-age=0')
2715
+ # # => {"myname"=>"myvalue", "max-age"=>"0"}
2716
+ #
2717
+ # source://rack//lib/rack/utils.rb#245
2718
+ def parse_cookies_header(value); end
2719
+
2720
+ # source://rack//lib/rack/utils.rb#113
2721
+ def parse_nested_query(qs, d = T.unsafe(nil)); end
2722
+
2723
+ # source://rack//lib/rack/utils.rb#109
2724
+ def parse_query(qs, d = T.unsafe(nil), &unescaper); end
2725
+
2726
+ # source://rack//lib/rack/utils.rb#145
2727
+ def q_values(q_value_header); end
2728
+
2729
+ # source://rack//lib/rack/utils.rb#425
2730
+ def rfc2822(time); end
2731
+
2732
+ # source://rack//lib/rack/utils.rb#476
2733
+ def secure_compare(a, b); end
2734
+
2735
+ # source://rack//lib/rack/utils.rb#203
2736
+ def select_best_encoding(available_encodings, accept_encoding); end
2737
+
2738
+ # :call-seq:
2739
+ # set_cookie_header(key, value) -> encoded string
2740
+ #
2741
+ # Generate an encoded string using the provided +key+ and +value+ suitable
2742
+ # for the +set-cookie+ header according to RFC6265. The +value+ may be an
2743
+ # instance of either +String+ or +Hash+.
2744
+ #
2745
+ # If the cookie +value+ is an instance of +Hash+, it considers the following
2746
+ # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance
2747
+ # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more
2748
+ # details about the interpretation of these fields, consult
2749
+ # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2).
2750
+ #
2751
+ # An extra cookie attribute +escape_key+ can be provided to control whether
2752
+ # or not the cookie key is URL encoded. If explicitly set to +false+, the
2753
+ # cookie key name will not be url encoded (escaped). The default is +true+.
2754
+ #
2755
+ # set_cookie_header("myname", "myvalue")
2756
+ # # => "myname=myvalue"
2757
+ #
2758
+ # set_cookie_header("myname", {value: "myvalue", max_age: 10})
2759
+ # # => "myname=myvalue; max-age=10"
2760
+ #
2761
+ # source://rack//lib/rack/utils.rb#306
2762
+ def set_cookie_header(key, value); end
2763
+
2764
+ # :call-seq:
2765
+ # set_cookie_header!(headers, key, value) -> header value
2766
+ #
2767
+ # Append a cookie in the specified headers with the given cookie +key+ and
2768
+ # +value+ using set_cookie_header.
2769
+ #
2770
+ # If the headers already contains a +set-cookie+ key, it will be converted
2771
+ # to an +Array+ if not already, and appended to.
2772
+ #
2773
+ # source://rack//lib/rack/utils.rb#348
2774
+ def set_cookie_header!(headers, key, value); end
2775
+
2776
+ # source://rack//lib/rack/utils.rb#626
2777
+ def status_code(status); end
2778
+
2779
+ # Unescapes a URI escaped string with +encoding+. +encoding+ will be the
2780
+ # target encoding of the string returned, and it defaults to UTF-8
2781
+ #
2782
+ # source://rack//lib/rack/utils.rb#56
2783
+ def unescape(s, encoding = T.unsafe(nil)); end
2784
+
2785
+ # Unescapes the **path** component of a URI. See Rack::Utils.unescape for
2786
+ # unescaping query parameters or form components.
2787
+ #
2788
+ # source://rack//lib/rack/utils.rb#50
2789
+ def unescape_path(s); end
2790
+
2791
+ # @return [Boolean]
2792
+ #
2793
+ # source://rack//lib/rack/utils.rb#653
2794
+ def valid_path?(path); end
2795
+ end
2796
+ end
2797
+
2798
+ # source://rack//lib/rack/utils.rb#24
2799
+ Rack::Utils::COMMON_SEP = T.let(T.unsafe(nil), Hash)
2800
+
2801
+ # Context allows the use of a compatible middleware at different points
2802
+ # in a request handling stack. A compatible middleware must define
2803
+ # #context which should take the arguments env and app. The first of which
2804
+ # would be the request environment. The second of which would be the rack
2805
+ # application that the request would be forwarded to.
2806
+ #
2807
+ # source://rack//lib/rack/utils.rb#499
2808
+ class Rack::Utils::Context
2809
+ # @return [Context] a new instance of Context
2810
+ #
2811
+ # source://rack//lib/rack/utils.rb#502
2812
+ def initialize(app_f, app_r); end
2813
+
2814
+ # Returns the value of attribute app.
2815
+ #
2816
+ # source://rack//lib/rack/utils.rb#500
2817
+ def app; end
2818
+
2819
+ # source://rack//lib/rack/utils.rb#507
2820
+ def call(env); end
2821
+
2822
+ # source://rack//lib/rack/utils.rb#515
2823
+ def context(env, app = T.unsafe(nil)); end
2824
+
2825
+ # Returns the value of attribute for.
2826
+ #
2827
+ # source://rack//lib/rack/utils.rb#500
2828
+ def for; end
2829
+
2830
+ # source://rack//lib/rack/utils.rb#511
2831
+ def recontext(app); end
2832
+ end
2833
+
2834
+ # source://rack//lib/rack/utils.rb#23
2835
+ Rack::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
2836
+
2837
+ # source://rack//lib/rack/utils.rb#187
2838
+ Rack::Utils::ESCAPE_HTML = T.let(T.unsafe(nil), Hash)
2839
+
2840
+ # source://rack//lib/rack/utils.rb#196
2841
+ Rack::Utils::ESCAPE_HTML_PATTERN = T.let(T.unsafe(nil), Regexp)
2842
+
2843
+ # Every standard HTTP code mapped to the appropriate message.
2844
+ # Generated with:
2845
+ # curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv | \
2846
+ # ruby -ne 'm = /^(\d{3}),(?!Unassigned|\(Unused\))([^,]+)/.match($_) and \
2847
+ # puts "#{m[1]} => \x27#{m[2].strip}\x27,"'
2848
+ #
2849
+ # source://rack//lib/rack/utils.rb#553
2850
+ Rack::Utils::HTTP_STATUS_CODES = T.let(T.unsafe(nil), Hash)
2851
+
2852
+ # A wrapper around Headers
2853
+ # header when set.
2854
+ #
2855
+ # @api private
2856
+ #
2857
+ # source://rack//lib/rack/utils.rb#524
2858
+ class Rack::Utils::HeaderHash < ::Hash
2859
+ class << self
2860
+ # @api private
2861
+ #
2862
+ # source://rack//lib/rack/utils.rb#525
2863
+ def [](headers); end
2864
+
2865
+ # @api private
2866
+ # @raise [TypeError]
2867
+ #
2868
+ # source://rack//lib/rack/utils.rb#543
2869
+ def allocate; end
2870
+
2871
+ # @api private
2872
+ #
2873
+ # source://rack//lib/rack/utils.rb#536
2874
+ def new(hash = T.unsafe(nil)); end
2875
+ end
2876
+ end
2877
+
2878
+ # source://rack//lib/rack/utils.rb#21
2879
+ Rack::Utils::InvalidParameterError = Rack::QueryParser::InvalidParameterError
2880
+
2881
+ # source://rack//lib/rack/utils.rb#25
2882
+ Rack::Utils::KeySpaceConstrainedParams = Rack::QueryParser::Params
2883
+
2884
+ # source://rack//lib/rack/utils.rb#651
2885
+ Rack::Utils::NULL_BYTE = T.let(T.unsafe(nil), String)
2886
+
2887
+ # source://rack//lib/rack/utils.rb#634
2888
+ Rack::Utils::PATH_SEPS = T.let(T.unsafe(nil), Regexp)
2889
+
2890
+ # source://rack//lib/rack/utils.rb#20
2891
+ Rack::Utils::ParameterTypeError = Rack::QueryParser::ParameterTypeError
2892
+
2893
+ # source://rack//lib/rack/utils.rb#22
2894
+ Rack::Utils::ParamsTooDeepError = Rack::QueryParser::ParamsTooDeepError
2895
+
2896
+ # Responses with HTTP status codes that should not have an entity body
2897
+ #
2898
+ # source://rack//lib/rack/utils.rb#620
2899
+ Rack::Utils::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash)
2900
+
2901
+ # source://rack//lib/rack/utils.rb#622
2902
+ Rack::Utils::SYMBOL_TO_STATUS_CODE = T.let(T.unsafe(nil), Hash)
2903
+
2904
+ # The Rack protocol version number implemented.
2905
+ #
2906
+ # source://rack//lib/rack/version.rb#16
2907
+ Rack::VERSION = T.let(T.unsafe(nil), Array)
2908
+
2909
+ # source://rack//lib/rack/version.rb#19
2910
+ Rack::VERSION_STRING = T.let(T.unsafe(nil), String)