rack 2.2.3.1 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rack might be problematic. Click here for more details.

Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +174 -69
  3. data/CONTRIBUTING.md +53 -47
  4. data/MIT-LICENSE +1 -1
  5. data/README.md +293 -0
  6. data/SPEC.rdoc +183 -131
  7. data/lib/rack/auth/abstract/handler.rb +3 -1
  8. data/lib/rack/auth/abstract/request.rb +3 -1
  9. data/lib/rack/auth/digest/md5.rb +1 -131
  10. data/lib/rack/auth/digest/nonce.rb +1 -54
  11. data/lib/rack/auth/digest/params.rb +1 -54
  12. data/lib/rack/auth/digest/request.rb +1 -43
  13. data/lib/rack/auth/digest.rb +256 -0
  14. data/lib/rack/body_proxy.rb +3 -1
  15. data/lib/rack/builder.rb +60 -42
  16. data/lib/rack/cascade.rb +2 -0
  17. data/lib/rack/chunked.rb +16 -13
  18. data/lib/rack/common_logger.rb +23 -18
  19. data/lib/rack/conditional_get.rb +18 -15
  20. data/lib/rack/constants.rb +63 -0
  21. data/lib/rack/content_length.rb +12 -16
  22. data/lib/rack/content_type.rb +8 -5
  23. data/lib/rack/deflater.rb +40 -26
  24. data/lib/rack/directory.rb +9 -3
  25. data/lib/rack/etag.rb +14 -21
  26. data/lib/rack/events.rb +4 -0
  27. data/lib/rack/file.rb +2 -0
  28. data/lib/rack/files.rb +15 -17
  29. data/lib/rack/head.rb +9 -8
  30. data/lib/rack/headers.rb +154 -0
  31. data/lib/rack/lint.rb +779 -684
  32. data/lib/rack/lock.rb +2 -5
  33. data/lib/rack/logger.rb +2 -0
  34. data/lib/rack/media_type.rb +1 -1
  35. data/lib/rack/method_override.rb +4 -0
  36. data/lib/rack/mime.rb +8 -0
  37. data/lib/rack/mock.rb +1 -271
  38. data/lib/rack/mock_request.rb +166 -0
  39. data/lib/rack/mock_response.rb +126 -0
  40. data/lib/rack/multipart/generator.rb +7 -5
  41. data/lib/rack/multipart/parser.rb +118 -61
  42. data/lib/rack/multipart/uploaded_file.rb +4 -0
  43. data/lib/rack/multipart.rb +20 -40
  44. data/lib/rack/null_logger.rb +9 -0
  45. data/lib/rack/query_parser.rb +80 -44
  46. data/lib/rack/recursive.rb +2 -0
  47. data/lib/rack/reloader.rb +0 -2
  48. data/lib/rack/request.rb +187 -89
  49. data/lib/rack/response.rb +131 -61
  50. data/lib/rack/rewindable_input.rb +24 -5
  51. data/lib/rack/runtime.rb +7 -6
  52. data/lib/rack/sendfile.rb +30 -25
  53. data/lib/rack/show_exceptions.rb +15 -2
  54. data/lib/rack/show_status.rb +17 -7
  55. data/lib/rack/static.rb +8 -8
  56. data/lib/rack/tempfile_reaper.rb +15 -4
  57. data/lib/rack/urlmap.rb +3 -1
  58. data/lib/rack/utils.rb +199 -170
  59. data/lib/rack/version.rb +9 -4
  60. data/lib/rack.rb +5 -76
  61. metadata +16 -36
  62. data/README.rdoc +0 -306
  63. data/Rakefile +0 -130
  64. data/bin/rackup +0 -5
  65. data/contrib/rack.png +0 -0
  66. data/contrib/rack.svg +0 -150
  67. data/contrib/rack_logo.svg +0 -164
  68. data/contrib/rdoc.css +0 -412
  69. data/example/lobster.ru +0 -6
  70. data/example/protectedlobster.rb +0 -16
  71. data/example/protectedlobster.ru +0 -10
  72. data/lib/rack/core_ext/regexp.rb +0 -14
  73. data/lib/rack/handler/cgi.rb +0 -59
  74. data/lib/rack/handler/fastcgi.rb +0 -100
  75. data/lib/rack/handler/lsws.rb +0 -61
  76. data/lib/rack/handler/scgi.rb +0 -71
  77. data/lib/rack/handler/thin.rb +0 -36
  78. data/lib/rack/handler/webrick.rb +0 -129
  79. data/lib/rack/handler.rb +0 -104
  80. data/lib/rack/lobster.rb +0 -70
  81. data/lib/rack/server.rb +0 -466
  82. data/lib/rack/session/abstract/id.rb +0 -523
  83. data/lib/rack/session/cookie.rb +0 -203
  84. data/lib/rack/session/memcache.rb +0 -10
  85. data/lib/rack/session/pool.rb +0 -85
  86. data/rack.gemspec +0 -46
data/lib/rack.rb CHANGED
@@ -12,70 +12,9 @@
12
12
  # so it should be enough just to <tt>require 'rack'</tt> in your code.
13
13
 
14
14
  require_relative 'rack/version'
15
+ require_relative 'rack/constants'
15
16
 
16
17
  module Rack
17
- HTTP_HOST = 'HTTP_HOST'
18
- HTTP_PORT = 'HTTP_PORT'
19
- HTTP_VERSION = 'HTTP_VERSION'
20
- HTTPS = 'HTTPS'
21
- PATH_INFO = 'PATH_INFO'
22
- REQUEST_METHOD = 'REQUEST_METHOD'
23
- REQUEST_PATH = 'REQUEST_PATH'
24
- SCRIPT_NAME = 'SCRIPT_NAME'
25
- QUERY_STRING = 'QUERY_STRING'
26
- SERVER_PROTOCOL = 'SERVER_PROTOCOL'
27
- SERVER_NAME = 'SERVER_NAME'
28
- SERVER_PORT = 'SERVER_PORT'
29
- CACHE_CONTROL = 'Cache-Control'
30
- EXPIRES = 'Expires'
31
- CONTENT_LENGTH = 'Content-Length'
32
- CONTENT_TYPE = 'Content-Type'
33
- SET_COOKIE = 'Set-Cookie'
34
- TRANSFER_ENCODING = 'Transfer-Encoding'
35
- HTTP_COOKIE = 'HTTP_COOKIE'
36
- ETAG = 'ETag'
37
-
38
- # HTTP method verbs
39
- GET = 'GET'
40
- POST = 'POST'
41
- PUT = 'PUT'
42
- PATCH = 'PATCH'
43
- DELETE = 'DELETE'
44
- HEAD = 'HEAD'
45
- OPTIONS = 'OPTIONS'
46
- LINK = 'LINK'
47
- UNLINK = 'UNLINK'
48
- TRACE = 'TRACE'
49
-
50
- # Rack environment variables
51
- RACK_VERSION = 'rack.version'
52
- RACK_TEMPFILES = 'rack.tempfiles'
53
- RACK_ERRORS = 'rack.errors'
54
- RACK_LOGGER = 'rack.logger'
55
- RACK_INPUT = 'rack.input'
56
- RACK_SESSION = 'rack.session'
57
- RACK_SESSION_OPTIONS = 'rack.session.options'
58
- RACK_SHOWSTATUS_DETAIL = 'rack.showstatus.detail'
59
- RACK_MULTITHREAD = 'rack.multithread'
60
- RACK_MULTIPROCESS = 'rack.multiprocess'
61
- RACK_RUNONCE = 'rack.run_once'
62
- RACK_URL_SCHEME = 'rack.url_scheme'
63
- RACK_HIJACK = 'rack.hijack'
64
- RACK_IS_HIJACK = 'rack.hijack?'
65
- RACK_HIJACK_IO = 'rack.hijack_io'
66
- RACK_RECURSIVE_INCLUDE = 'rack.recursive.include'
67
- RACK_MULTIPART_BUFFER_SIZE = 'rack.multipart.buffer_size'
68
- RACK_MULTIPART_TEMPFILE_FACTORY = 'rack.multipart.tempfile_factory'
69
- RACK_REQUEST_FORM_INPUT = 'rack.request.form_input'
70
- RACK_REQUEST_FORM_HASH = 'rack.request.form_hash'
71
- RACK_REQUEST_FORM_VARS = 'rack.request.form_vars'
72
- RACK_REQUEST_COOKIE_HASH = 'rack.request.cookie_hash'
73
- RACK_REQUEST_COOKIE_STRING = 'rack.request.cookie_string'
74
- RACK_REQUEST_QUERY_HASH = 'rack.request.query_hash'
75
- RACK_REQUEST_QUERY_STRING = 'rack.request.query_string'
76
- RACK_METHODOVERRIDE_ORIGINAL_METHOD = 'rack.methodoverride.original_method'
77
- RACK_SESSION_UNPACKED_COOKIE_DATA = 'rack.session.unpacked_cookie_data'
78
-
79
18
  autoload :Builder, "rack/builder"
80
19
  autoload :BodyProxy, "rack/body_proxy"
81
20
  autoload :Cascade, "rack/cascade"
@@ -94,6 +33,7 @@ module Rack
94
33
  autoload :ForwardRequest, "rack/recursive"
95
34
  autoload :Handler, "rack/handler"
96
35
  autoload :Head, "rack/head"
36
+ autoload :Headers, "rack/headers"
97
37
  autoload :Lint, "rack/lint"
98
38
  autoload :Lock, "rack/lock"
99
39
  autoload :Logger, "rack/logger"
@@ -115,8 +55,8 @@ module Rack
115
55
  autoload :Utils, "rack/utils"
116
56
  autoload :Multipart, "rack/multipart"
117
57
 
118
- autoload :MockRequest, "rack/mock"
119
- autoload :MockResponse, "rack/mock"
58
+ autoload :MockRequest, "rack/mock_request"
59
+ autoload :MockResponse, "rack/mock_response"
120
60
 
121
61
  autoload :Request, "rack/request"
122
62
  autoload :Response, "rack/response"
@@ -125,17 +65,6 @@ module Rack
125
65
  autoload :Basic, "rack/auth/basic"
126
66
  autoload :AbstractRequest, "rack/auth/abstract/request"
127
67
  autoload :AbstractHandler, "rack/auth/abstract/handler"
128
- module Digest
129
- autoload :MD5, "rack/auth/digest/md5"
130
- autoload :Nonce, "rack/auth/digest/nonce"
131
- autoload :Params, "rack/auth/digest/params"
132
- autoload :Request, "rack/auth/digest/request"
133
- end
134
- end
135
-
136
- module Session
137
- autoload :Cookie, "rack/session/cookie"
138
- autoload :Pool, "rack/session/pool"
139
- autoload :Memcache, "rack/session/memcache"
68
+ autoload :Digest, "rack/auth/digest"
140
69
  end
141
70
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3.1
4
+ version: 3.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leah Neukirchen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-27 00:00:00.000000000 Z
11
+ date: 2022-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: minitest-sprint
28
+ name: minitest-global_expectations
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: minitest-global_expectations
42
+ name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -73,32 +73,23 @@ description: |
73
73
  servers, web frameworks, and software in between (the so-called
74
74
  middleware) into a single method call.
75
75
  email: leah@vuxu.org
76
- executables:
77
- - rackup
76
+ executables: []
78
77
  extensions: []
79
78
  extra_rdoc_files:
80
- - README.rdoc
79
+ - README.md
81
80
  - CHANGELOG.md
82
81
  - CONTRIBUTING.md
83
82
  files:
84
83
  - CHANGELOG.md
85
84
  - CONTRIBUTING.md
86
85
  - MIT-LICENSE
87
- - README.rdoc
88
- - Rakefile
86
+ - README.md
89
87
  - SPEC.rdoc
90
- - bin/rackup
91
- - contrib/rack.png
92
- - contrib/rack.svg
93
- - contrib/rack_logo.svg
94
- - contrib/rdoc.css
95
- - example/lobster.ru
96
- - example/protectedlobster.rb
97
- - example/protectedlobster.ru
98
88
  - lib/rack.rb
99
89
  - lib/rack/auth/abstract/handler.rb
100
90
  - lib/rack/auth/abstract/request.rb
101
91
  - lib/rack/auth/basic.rb
92
+ - lib/rack/auth/digest.rb
102
93
  - lib/rack/auth/digest/md5.rb
103
94
  - lib/rack/auth/digest/nonce.rb
104
95
  - lib/rack/auth/digest/params.rb
@@ -110,31 +101,26 @@ files:
110
101
  - lib/rack/common_logger.rb
111
102
  - lib/rack/conditional_get.rb
112
103
  - lib/rack/config.rb
104
+ - lib/rack/constants.rb
113
105
  - lib/rack/content_length.rb
114
106
  - lib/rack/content_type.rb
115
- - lib/rack/core_ext/regexp.rb
116
107
  - lib/rack/deflater.rb
117
108
  - lib/rack/directory.rb
118
109
  - lib/rack/etag.rb
119
110
  - lib/rack/events.rb
120
111
  - lib/rack/file.rb
121
112
  - lib/rack/files.rb
122
- - lib/rack/handler.rb
123
- - lib/rack/handler/cgi.rb
124
- - lib/rack/handler/fastcgi.rb
125
- - lib/rack/handler/lsws.rb
126
- - lib/rack/handler/scgi.rb
127
- - lib/rack/handler/thin.rb
128
- - lib/rack/handler/webrick.rb
129
113
  - lib/rack/head.rb
114
+ - lib/rack/headers.rb
130
115
  - lib/rack/lint.rb
131
- - lib/rack/lobster.rb
132
116
  - lib/rack/lock.rb
133
117
  - lib/rack/logger.rb
134
118
  - lib/rack/media_type.rb
135
119
  - lib/rack/method_override.rb
136
120
  - lib/rack/mime.rb
137
121
  - lib/rack/mock.rb
122
+ - lib/rack/mock_request.rb
123
+ - lib/rack/mock_response.rb
138
124
  - lib/rack/multipart.rb
139
125
  - lib/rack/multipart/generator.rb
140
126
  - lib/rack/multipart/parser.rb
@@ -148,11 +134,6 @@ files:
148
134
  - lib/rack/rewindable_input.rb
149
135
  - lib/rack/runtime.rb
150
136
  - lib/rack/sendfile.rb
151
- - lib/rack/server.rb
152
- - lib/rack/session/abstract/id.rb
153
- - lib/rack/session/cookie.rb
154
- - lib/rack/session/memcache.rb
155
- - lib/rack/session/pool.rb
156
137
  - lib/rack/show_exceptions.rb
157
138
  - lib/rack/show_status.rb
158
139
  - lib/rack/static.rb
@@ -160,13 +141,12 @@ files:
160
141
  - lib/rack/urlmap.rb
161
142
  - lib/rack/utils.rb
162
143
  - lib/rack/version.rb
163
- - rack.gemspec
164
144
  homepage: https://github.com/rack/rack
165
145
  licenses:
166
146
  - MIT
167
147
  metadata:
168
148
  bug_tracker_uri: https://github.com/rack/rack/issues
169
- changelog_uri: https://github.com/rack/rack/blob/master/CHANGELOG.md
149
+ changelog_uri: https://github.com/rack/rack/blob/main/CHANGELOG.md
170
150
  documentation_uri: https://rubydoc.info/github/rack/rack
171
151
  source_code_uri: https://github.com/rack/rack
172
152
  post_install_message:
@@ -177,12 +157,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
177
157
  requirements:
178
158
  - - ">="
179
159
  - !ruby/object:Gem::Version
180
- version: 2.3.0
160
+ version: 2.4.0
181
161
  required_rubygems_version: !ruby/object:Gem::Requirement
182
162
  requirements:
183
- - - ">="
163
+ - - ">"
184
164
  - !ruby/object:Gem::Version
185
- version: '0'
165
+ version: 1.3.1
186
166
  requirements: []
187
167
  rubygems_version: 3.0.3.1
188
168
  signing_key:
data/README.rdoc DELETED
@@ -1,306 +0,0 @@
1
- = \Rack, a modular Ruby webserver interface
2
-
3
- {<img src="https://rack.github.io/logo.png" width="400" alt="rack powers web applications" />}[https://rack.github.io/]
4
-
5
- {<img src="https://circleci.com/gh/rack/rack.svg?style=svg" alt="CircleCI" />}[https://circleci.com/gh/rack/rack]
6
- {<img src="https://badge.fury.io/rb/rack.svg" alt="Gem Version" />}[http://badge.fury.io/rb/rack]
7
- {<img src="https://api.dependabot.com/badges/compatibility_score?dependency-name=rack&package-manager=bundler&version-scheme=semver" alt="SemVer Stability" />}[https://dependabot.com/compatibility-score.html?dependency-name=rack&package-manager=bundler&version-scheme=semver]
8
- {<img src="http://inch-ci.org/github/rack/rack.svg?branch=master" alt="Inline docs" />}[http://inch-ci.org/github/rack/rack]
9
-
10
- \Rack provides a minimal, modular, and adaptable interface for developing
11
- web applications in Ruby. By wrapping HTTP requests and responses in
12
- the simplest way possible, it unifies and distills the API for web
13
- servers, web frameworks, and software in between (the so-called
14
- middleware) into a single method call.
15
-
16
- The exact details of this are described in the \Rack specification,
17
- which all \Rack applications should conform to.
18
-
19
- == Supported web servers
20
-
21
- The included *handlers* connect all kinds of web servers to \Rack:
22
-
23
- * WEBrick[https://github.com/ruby/webrick]
24
- * FCGI
25
- * CGI
26
- * SCGI
27
- * LiteSpeed[https://www.litespeedtech.com/]
28
- * Thin[https://rubygems.org/gems/thin]
29
-
30
- These web servers include \Rack handlers in their distributions:
31
-
32
- * Agoo[https://github.com/ohler55/agoo]
33
- * Falcon[https://github.com/socketry/falcon]
34
- * Iodine[https://github.com/boazsegev/iodine]
35
- * {NGINX Unit}[https://unit.nginx.org/]
36
- * {Phusion Passenger}[https://www.phusionpassenger.com/] (which is mod_rack for Apache and for nginx)
37
- * Puma[https://puma.io/]
38
- * Unicorn[https://yhbt.net/unicorn/]
39
- * uWSGI[https://uwsgi-docs.readthedocs.io/en/latest/]
40
-
41
- Any valid \Rack app will run the same on all these handlers, without
42
- changing anything.
43
-
44
- == Supported web frameworks
45
-
46
- These frameworks and many others support the \Rack API:
47
-
48
- * Camping[http://www.ruby-camping.com/]
49
- * Coset[http://leahneukirchen.org/repos/coset/]
50
- * Hanami[https://hanamirb.org/]
51
- * Padrino[http://padrinorb.com/]
52
- * Ramaze[http://ramaze.net/]
53
- * Roda[https://github.com/jeremyevans/roda]
54
- * {Ruby on Rails}[https://rubyonrails.org/]
55
- * Rum[https://github.com/leahneukirchen/rum]
56
- * Sinatra[http://sinatrarb.com/]
57
- * Utopia[https://github.com/socketry/utopia]
58
- * WABuR[https://github.com/ohler55/wabur]
59
-
60
- == Available middleware shipped with \Rack
61
-
62
- Between the server and the framework, \Rack can be customized to your
63
- applications needs using middleware. \Rack itself ships with the following
64
- middleware:
65
-
66
- * Rack::Chunked, for streaming responses using chunked encoding.
67
- * Rack::CommonLogger, for creating Apache-style logfiles.
68
- * Rack::ConditionalGet, for returning not modified responses when the response
69
- has not changed.
70
- * Rack::Config, for modifying the environment before processing the request.
71
- * Rack::ContentLength, for setting Content-Length header based on body size.
72
- * Rack::ContentType, for setting default Content-Type header for responses.
73
- * Rack::Deflater, for compressing responses with gzip.
74
- * Rack::ETag, for setting ETag header on string bodies.
75
- * Rack::Events, for providing easy hooks when a request is received
76
- and when the response is sent.
77
- * Rack::Files, for serving static files.
78
- * Rack::Head, for returning an empty body for HEAD requests.
79
- * Rack::Lint, for checking conformance to the \Rack API.
80
- * Rack::Lock, for serializing requests using a mutex.
81
- * Rack::Logger, for setting a logger to handle logging errors.
82
- * Rack::MethodOverride, for modifying the request method based on a submitted
83
- parameter.
84
- * Rack::Recursive, for including data from other paths in the application,
85
- and for performing internal redirects.
86
- * Rack::Reloader, for reloading files if they have been modified.
87
- * Rack::Runtime, for including a response header with the time taken to
88
- process the request.
89
- * Rack::Sendfile, for working with web servers that can use optimized
90
- file serving for file system paths.
91
- * Rack::ShowException, for catching unhandled exceptions and
92
- presenting them in a nice and helpful way with clickable backtrace.
93
- * Rack::ShowStatus, for using nice error pages for empty client error
94
- responses.
95
- * Rack::Static, for more configurable serving of static files.
96
- * Rack::TempfileReaper, for removing temporary files creating during a
97
- request.
98
-
99
- All these components use the same interface, which is described in
100
- detail in the \Rack specification. These optional components can be
101
- used in any way you wish.
102
-
103
- == Convenience
104
-
105
- If you want to develop outside of existing frameworks, implement your
106
- own ones, or develop middleware, \Rack provides many helpers to create
107
- \Rack applications quickly and without doing the same web stuff all
108
- over:
109
-
110
- * Rack::Request, which also provides query string parsing and
111
- multipart handling.
112
- * Rack::Response, for convenient generation of HTTP replies and
113
- cookie handling.
114
- * Rack::MockRequest and Rack::MockResponse for efficient and quick
115
- testing of \Rack application without real HTTP round-trips.
116
- * Rack::Cascade, for trying additional \Rack applications if an
117
- application returns a not found or method not supported response.
118
- * Rack::Directory, for serving files under a given directory, with
119
- directory indexes.
120
- * Rack::MediaType, for parsing Content-Type headers.
121
- * Rack::Mime, for determining Content-Type based on file extension.
122
- * Rack::RewindableInput, for making any IO object rewindable, using
123
- a temporary file buffer.
124
- * Rack::URLMap, to route to multiple applications inside the same process.
125
-
126
- == rack-contrib
127
-
128
- The plethora of useful middleware created the need for a project that
129
- collects fresh \Rack middleware. rack-contrib includes a variety of
130
- add-on components for \Rack and it is easy to contribute new modules.
131
-
132
- * https://github.com/rack/rack-contrib
133
-
134
- == rackup
135
-
136
- rackup is a useful tool for running \Rack applications, which uses the
137
- Rack::Builder DSL to configure middleware and build up applications
138
- easily.
139
-
140
- rackup automatically figures out the environment it is run in, and
141
- runs your application as FastCGI, CGI, or WEBrick---all from the
142
- same configuration.
143
-
144
- == Quick start
145
-
146
- Try the lobster!
147
-
148
- Either with the embedded WEBrick starter:
149
-
150
- ruby -Ilib lib/rack/lobster.rb
151
-
152
- Or with rackup:
153
-
154
- bin/rackup -Ilib example/lobster.ru
155
-
156
- By default, the lobster is found at http://localhost:9292.
157
-
158
- == Installing with RubyGems
159
-
160
- A Gem of \Rack is available at {rubygems.org}[https://rubygems.org/gems/rack]. You can install it with:
161
-
162
- gem install rack
163
-
164
- == Usage
165
-
166
- You should require the library:
167
-
168
- require 'rack'
169
-
170
- \Rack uses autoload to automatically load other files \Rack ships with on demand,
171
- so you should not need require paths under +rack+. If you require paths under
172
- +rack+ without requiring +rack+ itself, things may not work correctly.
173
-
174
- == Configuration
175
-
176
- Several parameters can be modified on Rack::Utils to configure \Rack behaviour.
177
-
178
- e.g:
179
-
180
- Rack::Utils.key_space_limit = 128
181
-
182
- === key_space_limit
183
-
184
- The default number of bytes to allow all parameters keys in a given parameter hash to take up.
185
- Does not affect nested parameter hashes, so doesn't actually prevent an attacker from using
186
- more than this many bytes for parameter keys.
187
-
188
- Defaults to 65536 characters.
189
-
190
- === param_depth_limit
191
-
192
- The maximum amount of nesting allowed in parameters.
193
- For example, if set to 3, this query string would be allowed:
194
-
195
- ?a[b][c]=d
196
-
197
- but this query string would not be allowed:
198
-
199
- ?a[b][c][d]=e
200
-
201
- Limiting the depth prevents a possible stack overflow when parsing parameters.
202
-
203
- Defaults to 100.
204
-
205
- === multipart_part_limit
206
-
207
- The maximum number of parts a request can contain.
208
- Accepting too many part can lead to the server running out of file handles.
209
-
210
- The default is 128, which means that a single request can't upload more than 128 files at once.
211
-
212
- Set to 0 for no limit.
213
-
214
- Can also be set via the +RACK_MULTIPART_PART_LIMIT+ environment variable.
215
-
216
- == Changelog
217
-
218
- See {CHANGELOG.md}[https://github.com/rack/rack/blob/master/CHANGELOG.md].
219
-
220
- == Contributing
221
-
222
- See {CONTRIBUTING.md}[https://github.com/rack/rack/blob/master/CONTRIBUTING.md].
223
-
224
- == Contact
225
-
226
- Please post bugs, suggestions and patches to
227
- the bug tracker at {issues}[https://github.com/rack/rack/issues].
228
-
229
- Please post security related bugs and suggestions to the core team at
230
- <https://groups.google.com/forum/#!forum/rack-core> or rack-core@googlegroups.com. This
231
- list is not public. Due to wide usage of the library, it is strongly preferred
232
- that we manage timing in order to provide viable patches at the time of
233
- disclosure. Your assistance in this matter is greatly appreciated.
234
-
235
- Mailing list archives are available at
236
- <https://groups.google.com/forum/#!forum/rack-devel>.
237
-
238
- Git repository (send Git patches to the mailing list):
239
-
240
- * https://github.com/rack/rack
241
-
242
- You are also welcome to join the #rack channel on irc.freenode.net.
243
-
244
- == Thanks
245
-
246
- The \Rack Core Team, consisting of
247
-
248
- * Aaron Patterson (tenderlove[https://github.com/tenderlove])
249
- * Samuel Williams (ioquatix[https://github.com/ioquatix])
250
- * Jeremy Evans (jeremyevans[https://github.com/jeremyevans])
251
- * Eileen Uchitelle (eileencodes[https://github.com/eileencodes])
252
- * Matthew Draper (matthewd[https://github.com/matthewd])
253
- * Rafael França (rafaelfranca[https://github.com/rafaelfranca])
254
-
255
- and the \Rack Alumni
256
-
257
- * Ryan Tomayko (rtomayko[https://github.com/rtomayko])
258
- * Scytrin dai Kinthra (scytrin[https://github.com/scytrin])
259
- * Leah Neukirchen (leahneukirchen[https://github.com/leahneukirchen])
260
- * James Tucker (raggi[https://github.com/raggi])
261
- * Josh Peek (josh[https://github.com/josh])
262
- * José Valim (josevalim[https://github.com/josevalim])
263
- * Michael Fellinger (manveru[https://github.com/manveru])
264
- * Santiago Pastorino (spastorino[https://github.com/spastorino])
265
- * Konstantin Haase (rkh[https://github.com/rkh])
266
-
267
- would like to thank:
268
-
269
- * Adrian Madrid, for the LiteSpeed handler.
270
- * Christoffer Sawicki, for the first Rails adapter and Rack::Deflater.
271
- * Tim Fletcher, for the HTTP authentication code.
272
- * Luc Heinrich for the Cookie sessions, the static file handler and bugfixes.
273
- * Armin Ronacher, for the logo and racktools.
274
- * Alex Beregszaszi, Alexander Kahn, Anil Wadghule, Aredridel, Ben
275
- Alpert, Dan Kubb, Daniel Roethlisberger, Matt Todd, Tom Robinson,
276
- Phil Hagelberg, S. Brent Faulkner, Bosko Milekic, Daniel Rodríguez
277
- Troitiño, Genki Takiuchi, Geoffrey Grosenbach, Julien Sanchez, Kamal
278
- Fariz Mahyuddin, Masayoshi Takahashi, Patrick Aljordm, Mig, Kazuhiro
279
- Nishiyama, Jon Bardin, Konstantin Haase, Larry Siden, Matias
280
- Korhonen, Sam Ruby, Simon Chiang, Tim Connor, Timur Batyrshin, and
281
- Zach Brock for bug fixing and other improvements.
282
- * Eric Wong, Hongli Lai, Jeremy Kemper for their continuous support
283
- and API improvements.
284
- * Yehuda Katz and Carl Lerche for refactoring rackup.
285
- * Brian Candler, for Rack::ContentType.
286
- * Graham Batty, for improved handler loading.
287
- * Stephen Bannasch, for bug reports and documentation.
288
- * Gary Wright, for proposing a better Rack::Response interface.
289
- * Jonathan Buch, for improvements regarding Rack::Response.
290
- * Armin Röhrl, for tracking down bugs in the Cookie generator.
291
- * Alexander Kellett for testing the Gem and reviewing the announcement.
292
- * Marcus Rückert, for help with configuring and debugging lighttpd.
293
- * The WSGI team for the well-done and documented work they've done and
294
- \Rack builds up on.
295
- * All bug reporters and patch contributors not mentioned above.
296
-
297
- == Links
298
-
299
- \Rack:: <https://rack.github.io/>
300
- Official \Rack repositories:: <https://github.com/rack>
301
- \Rack Bug Tracking:: <https://github.com/rack/rack/issues>
302
- rack-devel mailing list:: <https://groups.google.com/forum/#!forum/rack-devel>
303
-
304
- == License
305
-
306
- \Rack is released under the {MIT License}[https://opensource.org/licenses/MIT].
data/Rakefile DELETED
@@ -1,130 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rake/testtask"
5
-
6
- desc "Run all the tests"
7
- task default: :test
8
-
9
- desc "Install gem dependencies"
10
- task :deps do
11
- require 'rubygems'
12
- spec = Gem::Specification.load('rack.gemspec')
13
- spec.dependencies.each do |dep|
14
- reqs = dep.requirements_list
15
- reqs = (["-v"] * reqs.size).zip(reqs).flatten
16
- # Use system over sh, because we want to ignore errors!
17
- system Gem.ruby, "-S", "gem", "install", '--conservative', dep.name, *reqs
18
- end
19
- end
20
-
21
- desc "Make an archive as .tar.gz"
22
- task dist: %w[chmod changelog spec rdoc] do
23
- sh "git archive --format=tar --prefix=#{release}/ HEAD^{tree} >#{release}.tar"
24
- sh "pax -waf #{release}.tar -s ':^:#{release}/:' SPEC.rdoc ChangeLog doc rack.gemspec"
25
- sh "gzip -f -9 #{release}.tar"
26
- end
27
-
28
- desc "Make an official release"
29
- task :officialrelease do
30
- puts "Official build for #{release}..."
31
- sh "rm -rf stage"
32
- sh "git clone --shared . stage"
33
- sh "cd stage && rake officialrelease_really"
34
- sh "mv stage/#{release}.tar.gz stage/#{release}.gem ."
35
- end
36
-
37
- task officialrelease_really: %w[spec dist gem] do
38
- sh "shasum #{release}.tar.gz #{release}.gem"
39
- end
40
-
41
- def release
42
- "rack-" + File.read('lib/rack/version.rb')[/RELEASE += +([\"\'])([\d][\w\.]+)\1/, 2]
43
- end
44
-
45
- desc "Make binaries executable"
46
- task :chmod do
47
- Dir["bin/*"].each { |binary| File.chmod(0755, binary) }
48
- Dir["test/cgi/test*"].each { |binary| File.chmod(0755, binary) }
49
- end
50
-
51
- desc "Generate a ChangeLog"
52
- task changelog: "ChangeLog"
53
-
54
- file '.git/index'
55
- file "ChangeLog" => '.git/index' do
56
- File.open("ChangeLog", "w") { |out|
57
- log = `git log -z`
58
- log.force_encoding(Encoding::BINARY)
59
- log.split("\0").map { |chunk|
60
- author = chunk[/Author: (.*)/, 1].strip
61
- date = chunk[/Date: (.*)/, 1].strip
62
- desc, detail = $'.strip.split("\n", 2)
63
- detail ||= ""
64
- detail = detail.gsub(/.*darcs-hash:.*/, '')
65
- detail.rstrip!
66
- out.puts "#{date} #{author}"
67
- out.puts " * #{desc.strip}"
68
- out.puts detail unless detail.empty?
69
- out.puts
70
- }
71
- }
72
- end
73
-
74
- desc "Generate Rack Specification"
75
- task spec: "SPEC.rdoc"
76
-
77
- file 'lib/rack/lint.rb'
78
- file "SPEC.rdoc" => 'lib/rack/lint.rb' do
79
- File.open("SPEC.rdoc", "wb") { |file|
80
- IO.foreach("lib/rack/lint.rb") { |line|
81
- if line =~ /^\s*## ?(.*)/
82
- file.puts $1
83
- end
84
- }
85
- }
86
- end
87
-
88
- Rake::TestTask.new("test:regular") do |t|
89
- t.libs << "test"
90
- t.test_files = FileList["test/**/*_test.rb", "test/**/spec_*.rb", "test/gemloader.rb"]
91
- t.warning = false
92
- t.verbose = true
93
- end
94
-
95
- desc "Run tests with coverage"
96
- task "test_cov" do
97
- ENV['COVERAGE'] = '1'
98
- Rake::Task['test:regular'].invoke
99
- end
100
-
101
- desc "Run all the fast + platform agnostic tests"
102
- task test: %w[spec test:regular]
103
-
104
- desc "Run all the tests we run on CI"
105
- task ci: :test
106
-
107
- task gem: :spec do
108
- sh "gem build rack.gemspec"
109
- end
110
-
111
- task doc: :rdoc
112
-
113
- desc "Generate RDoc documentation"
114
- task rdoc: %w[changelog spec] do
115
- sh(*%w{rdoc --line-numbers --main README.rdoc
116
- --title 'Rack\ Documentation' --charset utf-8 -U -o doc} +
117
- %w{README.rdoc KNOWN-ISSUES SPEC.rdoc ChangeLog} +
118
- `git ls-files lib/\*\*/\*.rb`.strip.split)
119
- cp "contrib/rdoc.css", "doc/rdoc.css"
120
- end
121
-
122
- task pushdoc: :rdoc do
123
- sh "rsync -avz doc/ rack.rubyforge.org:/var/www/gforge-projects/rack/doc/"
124
- end
125
-
126
- task pushsite: :pushdoc do
127
- sh "cd site && git gc"
128
- sh "rsync -avz site/ rack.rubyforge.org:/var/www/gforge-projects/rack/"
129
- sh "cd site && git push"
130
- end