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