rack 1.4.7 → 2.1.4

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 (183) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +77 -0
  3. data/{COPYING → MIT-LICENSE} +4 -2
  4. data/README.rdoc +122 -456
  5. data/Rakefile +32 -31
  6. data/SPEC +119 -29
  7. data/bin/rackup +1 -0
  8. data/contrib/rack_logo.svg +164 -111
  9. data/example/lobster.ru +2 -0
  10. data/example/protectedlobster.rb +4 -2
  11. data/example/protectedlobster.ru +3 -1
  12. data/lib/rack/auth/abstract/handler.rb +7 -5
  13. data/lib/rack/auth/abstract/request.rb +8 -6
  14. data/lib/rack/auth/basic.rb +5 -2
  15. data/lib/rack/auth/digest/md5.rb +10 -8
  16. data/lib/rack/auth/digest/nonce.rb +6 -3
  17. data/lib/rack/auth/digest/params.rb +5 -4
  18. data/lib/rack/auth/digest/request.rb +4 -2
  19. data/lib/rack/body_proxy.rb +11 -9
  20. data/lib/rack/builder.rb +63 -20
  21. data/lib/rack/cascade.rb +10 -9
  22. data/lib/rack/chunked.rb +45 -11
  23. data/lib/rack/{commonlogger.rb → common_logger.rb} +24 -15
  24. data/lib/rack/{conditionalget.rb → conditional_get.rb} +20 -6
  25. data/lib/rack/config.rb +7 -0
  26. data/lib/rack/content_length.rb +12 -6
  27. data/lib/rack/content_type.rb +4 -2
  28. data/lib/rack/core_ext/regexp.rb +14 -0
  29. data/lib/rack/deflater.rb +73 -42
  30. data/lib/rack/directory.rb +77 -56
  31. data/lib/rack/etag.rb +25 -13
  32. data/lib/rack/events.rb +156 -0
  33. data/lib/rack/file.rb +4 -143
  34. data/lib/rack/files.rb +178 -0
  35. data/lib/rack/handler/cgi.rb +18 -17
  36. data/lib/rack/handler/fastcgi.rb +21 -17
  37. data/lib/rack/handler/lsws.rb +14 -12
  38. data/lib/rack/handler/scgi.rb +27 -21
  39. data/lib/rack/handler/thin.rb +19 -5
  40. data/lib/rack/handler/webrick.rb +66 -24
  41. data/lib/rack/handler.rb +29 -19
  42. data/lib/rack/head.rb +21 -14
  43. data/lib/rack/lint.rb +259 -65
  44. data/lib/rack/lobster.rb +17 -10
  45. data/lib/rack/lock.rb +19 -10
  46. data/lib/rack/logger.rb +4 -2
  47. data/lib/rack/media_type.rb +43 -0
  48. data/lib/rack/method_override.rb +52 -0
  49. data/lib/rack/mime.rb +43 -6
  50. data/lib/rack/mock.rb +109 -44
  51. data/lib/rack/multipart/generator.rb +11 -12
  52. data/lib/rack/multipart/parser.rb +302 -115
  53. data/lib/rack/multipart/uploaded_file.rb +4 -3
  54. data/lib/rack/multipart.rb +40 -9
  55. data/lib/rack/null_logger.rb +39 -0
  56. data/lib/rack/query_parser.rb +218 -0
  57. data/lib/rack/recursive.rb +14 -11
  58. data/lib/rack/reloader.rb +12 -5
  59. data/lib/rack/request.rb +484 -270
  60. data/lib/rack/response.rb +196 -77
  61. data/lib/rack/rewindable_input.rb +5 -14
  62. data/lib/rack/runtime.rb +13 -6
  63. data/lib/rack/sendfile.rb +44 -20
  64. data/lib/rack/server.rb +175 -61
  65. data/lib/rack/session/abstract/id.rb +276 -133
  66. data/lib/rack/session/cookie.rb +75 -40
  67. data/lib/rack/session/memcache.rb +4 -87
  68. data/lib/rack/session/pool.rb +24 -18
  69. data/lib/rack/show_exceptions.rb +392 -0
  70. data/lib/rack/{showstatus.rb → show_status.rb} +11 -9
  71. data/lib/rack/static.rb +65 -38
  72. data/lib/rack/tempfile_reaper.rb +24 -0
  73. data/lib/rack/urlmap.rb +40 -15
  74. data/lib/rack/utils.rb +316 -285
  75. data/lib/rack.rb +78 -23
  76. data/rack.gemspec +26 -19
  77. metadata +44 -209
  78. data/KNOWN-ISSUES +0 -30
  79. data/lib/rack/backports/uri/common_18.rb +0 -56
  80. data/lib/rack/backports/uri/common_192.rb +0 -52
  81. data/lib/rack/backports/uri/common_193.rb +0 -29
  82. data/lib/rack/handler/evented_mongrel.rb +0 -8
  83. data/lib/rack/handler/mongrel.rb +0 -100
  84. data/lib/rack/handler/swiftiplied_mongrel.rb +0 -8
  85. data/lib/rack/methodoverride.rb +0 -33
  86. data/lib/rack/nulllogger.rb +0 -18
  87. data/lib/rack/showexceptions.rb +0 -378
  88. data/test/builder/anything.rb +0 -5
  89. data/test/builder/comment.ru +0 -4
  90. data/test/builder/end.ru +0 -5
  91. data/test/builder/line.ru +0 -1
  92. data/test/builder/options.ru +0 -2
  93. data/test/cgi/assets/folder/test.js +0 -1
  94. data/test/cgi/assets/fonts/font.eot +0 -1
  95. data/test/cgi/assets/images/image.png +0 -1
  96. data/test/cgi/assets/index.html +0 -1
  97. data/test/cgi/assets/javascripts/app.js +0 -1
  98. data/test/cgi/assets/stylesheets/app.css +0 -1
  99. data/test/cgi/lighttpd.conf +0 -26
  100. data/test/cgi/lighttpd.errors +0 -1
  101. data/test/cgi/rackup_stub.rb +0 -6
  102. data/test/cgi/sample_rackup.ru +0 -5
  103. data/test/cgi/test +0 -9
  104. data/test/cgi/test+directory/test+file +0 -1
  105. data/test/cgi/test.fcgi +0 -8
  106. data/test/cgi/test.ru +0 -5
  107. data/test/gemloader.rb +0 -10
  108. data/test/multipart/bad_robots +0 -259
  109. data/test/multipart/binary +0 -0
  110. data/test/multipart/content_type_and_no_filename +0 -6
  111. data/test/multipart/empty +0 -10
  112. data/test/multipart/fail_16384_nofile +0 -814
  113. data/test/multipart/file1.txt +0 -1
  114. data/test/multipart/filename_and_modification_param +0 -7
  115. data/test/multipart/filename_with_escaped_quotes +0 -6
  116. data/test/multipart/filename_with_escaped_quotes_and_modification_param +0 -7
  117. data/test/multipart/filename_with_percent_escaped_quotes +0 -6
  118. data/test/multipart/filename_with_unescaped_percentages +0 -6
  119. data/test/multipart/filename_with_unescaped_percentages2 +0 -6
  120. data/test/multipart/filename_with_unescaped_percentages3 +0 -6
  121. data/test/multipart/filename_with_unescaped_quotes +0 -6
  122. data/test/multipart/ie +0 -6
  123. data/test/multipart/mixed_files +0 -21
  124. data/test/multipart/nested +0 -10
  125. data/test/multipart/none +0 -9
  126. data/test/multipart/semicolon +0 -6
  127. data/test/multipart/text +0 -15
  128. data/test/multipart/three_files_three_fields +0 -31
  129. data/test/multipart/webkit +0 -32
  130. data/test/rackup/config.ru +0 -31
  131. data/test/registering_handler/rack/handler/registering_myself.rb +0 -8
  132. data/test/spec_auth.rb +0 -57
  133. data/test/spec_auth_basic.rb +0 -81
  134. data/test/spec_auth_digest.rb +0 -259
  135. data/test/spec_body_proxy.rb +0 -69
  136. data/test/spec_builder.rb +0 -207
  137. data/test/spec_cascade.rb +0 -61
  138. data/test/spec_cgi.rb +0 -102
  139. data/test/spec_chunked.rb +0 -87
  140. data/test/spec_commonlogger.rb +0 -57
  141. data/test/spec_conditionalget.rb +0 -102
  142. data/test/spec_config.rb +0 -22
  143. data/test/spec_content_length.rb +0 -86
  144. data/test/spec_content_type.rb +0 -45
  145. data/test/spec_deflater.rb +0 -187
  146. data/test/spec_directory.rb +0 -88
  147. data/test/spec_etag.rb +0 -98
  148. data/test/spec_fastcgi.rb +0 -107
  149. data/test/spec_file.rb +0 -200
  150. data/test/spec_handler.rb +0 -59
  151. data/test/spec_head.rb +0 -48
  152. data/test/spec_lint.rb +0 -515
  153. data/test/spec_lobster.rb +0 -58
  154. data/test/spec_lock.rb +0 -167
  155. data/test/spec_logger.rb +0 -23
  156. data/test/spec_methodoverride.rb +0 -72
  157. data/test/spec_mock.rb +0 -269
  158. data/test/spec_mongrel.rb +0 -182
  159. data/test/spec_multipart.rb +0 -479
  160. data/test/spec_nulllogger.rb +0 -23
  161. data/test/spec_recursive.rb +0 -72
  162. data/test/spec_request.rb +0 -955
  163. data/test/spec_response.rb +0 -313
  164. data/test/spec_rewindable_input.rb +0 -118
  165. data/test/spec_runtime.rb +0 -49
  166. data/test/spec_sendfile.rb +0 -90
  167. data/test/spec_server.rb +0 -121
  168. data/test/spec_session_abstract_id.rb +0 -43
  169. data/test/spec_session_cookie.rb +0 -361
  170. data/test/spec_session_memcache.rb +0 -321
  171. data/test/spec_session_pool.rb +0 -209
  172. data/test/spec_showexceptions.rb +0 -92
  173. data/test/spec_showstatus.rb +0 -84
  174. data/test/spec_static.rb +0 -145
  175. data/test/spec_thin.rb +0 -86
  176. data/test/spec_urlmap.rb +0 -213
  177. data/test/spec_utils.rb +0 -554
  178. data/test/spec_webrick.rb +0 -143
  179. data/test/static/another/index.html +0 -1
  180. data/test/static/index.html +0 -1
  181. data/test/testrequest.rb +0 -78
  182. data/test/unregistered_handler/rack/handler/unregistered.rb +0 -7
  183. data/test/unregistered_handler/rack/handler/unregistered_long_one.rb +0 -7
data/README.rdoc CHANGED
@@ -1,110 +1,109 @@
1
- = Rack, a modular Ruby webserver interface {<img src="https://secure.travis-ci.org/rack/rack.png" alt="Build Status" />}[http://travis-ci.org/rack/rack] {<img src="https://gemnasium.com/rack/rack.png" alt="Dependency Status" />}[https://gemnasium.com/rack/rack]
1
+ = \Rack, a modular Ruby webserver interface
2
2
 
3
- Rack provides a minimal, modular and adaptable interface for developing
4
- web applications in Ruby. By wrapping HTTP requests and responses in
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
+
9
+ \Rack provides a minimal, modular, and adaptable interface for developing
10
+ web applications in Ruby. By wrapping HTTP requests and responses in
5
11
  the simplest way possible, it unifies and distills the API for web
6
12
  servers, web frameworks, and software in between (the so-called
7
13
  middleware) into a single method call.
8
14
 
9
- The exact details of this are described in the Rack specification,
10
- which all Rack applications should conform to.
15
+ The exact details of this are described in the \Rack specification,
16
+ which all \Rack applications should conform to.
11
17
 
12
18
  == Supported web servers
13
19
 
14
- The included *handlers* connect all kinds of web servers to Rack:
15
- * Mongrel
16
- * EventedMongrel
17
- * SwiftipliedMongrel
18
- * WEBrick
20
+ The included *handlers* connect all kinds of web servers to \Rack:
21
+
22
+ * WEBrick[https://github.com/ruby/webrick]
19
23
  * FCGI
20
24
  * CGI
21
25
  * SCGI
22
- * LiteSpeed
23
- * Thin
24
-
25
- These web servers include Rack handlers in their distributions:
26
- * Ebb
27
- * Fuzed
28
- * Glassfish v3
29
- * Phusion Passenger (which is mod_rack for Apache and for nginx)
30
- * Puma
31
- * Rainbows!
32
- * Unicorn
33
- * unixrack
34
- * uWSGI
35
- * Zbatery
36
-
37
- Any valid Rack app will run the same on all these handlers, without
26
+ * LiteSpeed[https://www.litespeedtech.com/]
27
+ * Thin[https://rubygems.org/gems/thin]
28
+
29
+ These web servers include \Rack handlers in their distributions:
30
+
31
+ * Agoo[https://github.com/ohler55/agoo]
32
+ * Falcon[https://github.com/socketry/falcon]
33
+ * {NGINX Unit}[https://unit.nginx.org/]
34
+ * {Phusion Passenger}[https://www.phusionpassenger.com/] (which is mod_rack for Apache and for nginx)
35
+ * Puma[https://puma.io/]
36
+ * Unicorn[https://bogomips.org/unicorn/]
37
+ * uWSGI[https://uwsgi-docs.readthedocs.io/en/latest/]
38
+
39
+ Any valid \Rack app will run the same on all these handlers, without
38
40
  changing anything.
39
41
 
40
42
  == Supported web frameworks
41
43
 
42
- These frameworks include Rack adapters in their distributions:
43
- * Camping
44
- * Coset
45
- * Halcyon
46
- * Mack
47
- * Maveric
48
- * Merb
44
+ These frameworks include \Rack adapters in their distributions:
45
+
46
+ * Camping[http://www.ruby-camping.com/]
47
+ * Coset[http://leahneukirchen.org/repos/coset/]
48
+ * Hanami[https://hanamirb.org/]
49
+ * Padrino[http://padrinorb.com/]
49
50
  * Racktools::SimpleApplication
50
- * Ramaze
51
- * Ruby on Rails
52
- * Rum
53
- * Sinatra
54
- * Sin
55
- * Vintage
56
- * Waves
57
- * Wee
51
+ * Ramaze[http://ramaze.net/]
52
+ * Roda[https://github.com/jeremyevans/roda]
53
+ * {Ruby on Rails}[https://rubyonrails.org/]
54
+ * Rum[https://github.com/leahneukirchen/rum]
55
+ * Sinatra[http://sinatrarb.com/]
56
+ * Utopia[https://github.com/socketry/utopia]
57
+ * WABuR[https://github.com/ohler55/wabur]
58
58
  * ... and many others.
59
59
 
60
- Current links to these projects can be found at
61
- http://wiki.ramaze.net/Home#other-frameworks
62
-
63
60
  == Available middleware
64
61
 
65
- Between the server and the framework, Rack can be customized to your
62
+ Between the server and the framework, \Rack can be customized to your
66
63
  applications needs using middleware, for example:
64
+
67
65
  * Rack::URLMap, to route to multiple applications inside the same process.
68
66
  * Rack::CommonLogger, for creating Apache-style logfiles.
69
67
  * Rack::ShowException, for catching unhandled exceptions and
70
68
  presenting them in a nice and helpful way with clickable backtrace.
71
- * Rack::File, for serving static files.
69
+ * Rack::Files, for serving static files.
72
70
  * ...many others!
73
71
 
74
72
  All these components use the same interface, which is described in
75
- detail in the Rack specification. These optional components can be
73
+ detail in the \Rack specification. These optional components can be
76
74
  used in any way you wish.
77
75
 
78
76
  == Convenience
79
77
 
80
78
  If you want to develop outside of existing frameworks, implement your
81
- own ones, or develop middleware, Rack provides many helpers to create
82
- Rack applications quickly and without doing the same web stuff all
79
+ own ones, or develop middleware, \Rack provides many helpers to create
80
+ \Rack applications quickly and without doing the same web stuff all
83
81
  over:
82
+
84
83
  * Rack::Request, which also provides query string parsing and
85
84
  multipart handling.
86
85
  * Rack::Response, for convenient generation of HTTP replies and
87
86
  cookie handling.
88
87
  * Rack::MockRequest and Rack::MockResponse for efficient and quick
89
- testing of Rack application without real HTTP round-trips.
88
+ testing of \Rack application without real HTTP round-trips.
90
89
 
91
90
  == rack-contrib
92
91
 
93
92
  The plethora of useful middleware created the need for a project that
94
- collects fresh Rack middleware. rack-contrib includes a variety of
95
- add-on components for Rack and it is easy to contribute new modules.
93
+ collects fresh \Rack middleware. rack-contrib includes a variety of
94
+ add-on components for \Rack and it is easy to contribute new modules.
96
95
 
97
- * http://github.com/rack/rack-contrib
96
+ * https://github.com/rack/rack-contrib
98
97
 
99
98
  == rackup
100
99
 
101
- rackup is a useful tool for running Rack applications, which uses the
100
+ rackup is a useful tool for running \Rack applications, which uses the
102
101
  Rack::Builder DSL to configure middleware and build up applications
103
102
  easily.
104
103
 
105
104
  rackup automatically figures out the environment it is run in, and
106
- runs your application as FastCGI, CGI, or standalone with Mongrel or
107
- WEBrick---all from the same configuration.
105
+ runs your application as FastCGI, CGI, or WEBrick---all from the
106
+ same configuration.
108
107
 
109
108
  == Quick start
110
109
 
@@ -122,18 +121,13 @@ By default, the lobster is found at http://localhost:9292.
122
121
 
123
122
  == Installing with RubyGems
124
123
 
125
- A Gem of Rack is available at rubygems.org. You can install it with:
124
+ A Gem of \Rack is available at {rubygems.org}[https://rubygems.org/gems/rack]. You can install it with:
126
125
 
127
126
  gem install rack
128
127
 
129
- I also provide a local mirror of the gems (and development snapshots)
130
- at my site:
131
-
132
- gem install rack --source http://chneukirchen.org/releases/gems/
133
-
134
128
  == Running the tests
135
129
 
136
- Testing Rack requires the bacon testing framework:
130
+ Testing \Rack requires the bacon testing framework:
137
131
 
138
132
  bundle install --without extra # to be able to run the fast tests
139
133
 
@@ -141,397 +135,90 @@ Or:
141
135
 
142
136
  bundle install # this assumes that you have installed native extensions!
143
137
 
144
- There are two rake-based test tasks:
138
+ There is a rake-based test task:
145
139
 
146
- rake test tests all the fast tests (no Handlers or Adapters)
147
- rake fulltest runs all the tests
140
+ rake test # tests all the tests
148
141
 
149
- The fast testsuite has no dependencies outside of the core Ruby
142
+ The testsuite has no dependencies outside of the core Ruby
150
143
  installation and bacon.
151
144
 
152
145
  To run the test suite completely, you need:
153
146
 
154
147
  * fcgi
155
- * memcache-client
156
- * mongrel
148
+ * dalli
157
149
  * thin
158
150
 
159
- The full set of tests test FCGI access with lighttpd (on port
160
- 9203) so you will need lighttpd installed as well as the FCGI
161
- libraries and the fcgi gem:
162
-
163
- Download and install lighttpd:
164
-
165
- http://www.lighttpd.net/download
166
-
167
- Installing the FCGI libraries:
168
-
169
- curl -O http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
170
- tar xzvf fcgi-2.4.0.tar.gz
171
- cd fcgi-2.4.0
172
- ./configure --prefix=/usr/local
173
- make
174
- sudo make install
175
- cd ..
176
-
177
- Installing the Ruby fcgi gem:
178
-
179
- gem install fcgi
180
-
181
- Furthermore, to test Memcache sessions, you need memcached (will be
182
- run on port 11211) and memcache-client installed.
183
-
184
- == History
185
-
186
- * March 3rd, 2007: First public release 0.1.
187
-
188
- * May 16th, 2007: Second public release 0.2.
189
- * HTTP Basic authentication.
190
- * Cookie Sessions.
191
- * Static file handler.
192
- * Improved Rack::Request.
193
- * Improved Rack::Response.
194
- * Added Rack::ShowStatus, for better default error messages.
195
- * Bug fixes in the Camping adapter.
196
- * Removed Rails adapter, was too alpha.
197
-
198
- * February 26th, 2008: Third public release 0.3.
199
- * LiteSpeed handler, by Adrian Madrid.
200
- * SCGI handler, by Jeremy Evans.
201
- * Pool sessions, by blink.
202
- * OpenID authentication, by blink.
203
- * :Port and :File options for opening FastCGI sockets, by blink.
204
- * Last-Modified HTTP header for Rack::File, by blink.
205
- * Rack::Builder#use now accepts blocks, by Corey Jewett.
206
- (See example/protectedlobster.ru)
207
- * HTTP status 201 can contain a Content-Type and a body now.
208
- * Many bugfixes, especially related to Cookie handling.
209
-
210
- * August 21st, 2008: Fourth public release 0.4.
211
- * New middleware, Rack::Deflater, by Christoffer Sawicki.
212
- * OpenID authentication now needs ruby-openid 2.
213
- * New Memcache sessions, by blink.
214
- * Explicit EventedMongrel handler, by Joshua Peek <josh@joshpeek.com>
215
- * Rack::Reloader is not loaded in rackup development mode.
216
- * rackup can daemonize with -D.
217
- * Many bugfixes, especially for pool sessions, URLMap, thread safety
218
- and tempfile handling.
219
- * Improved tests.
220
- * Rack moved to Git.
221
-
222
- * January 6th, 2009: Fifth public release 0.9.
223
- * Rack is now managed by the Rack Core Team.
224
- * Rack::Lint is stricter and follows the HTTP RFCs more closely.
225
- * Added ConditionalGet middleware.
226
- * Added ContentLength middleware.
227
- * Added Deflater middleware.
228
- * Added Head middleware.
229
- * Added MethodOverride middleware.
230
- * Rack::Mime now provides popular MIME-types and their extension.
231
- * Mongrel Header now streams.
232
- * Added Thin handler.
233
- * Official support for swiftiplied Mongrel.
234
- * Secure cookies.
235
- * Made HeaderHash case-preserving.
236
- * Many bugfixes and small improvements.
237
-
238
- * January 9th, 2009: Sixth public release 0.9.1.
239
- * Fix directory traversal exploits in Rack::File and Rack::Directory.
240
-
241
- * April 25th, 2009: Seventh public release 1.0.0.
242
- * SPEC change: Rack::VERSION has been pushed to [1,0].
243
- * SPEC change: header values must be Strings now, split on "\n".
244
- * SPEC change: Content-Length can be missing, in this case chunked transfer
245
- encoding is used.
246
- * SPEC change: rack.input must be rewindable and support reading into
247
- a buffer, wrap with Rack::RewindableInput if it isn't.
248
- * SPEC change: rack.session is now specified.
249
- * SPEC change: Bodies can now additionally respond to #to_path with
250
- a filename to be served.
251
- * NOTE: String bodies break in 1.9, use an Array consisting of a
252
- single String instead.
253
- * New middleware Rack::Lock.
254
- * New middleware Rack::ContentType.
255
- * Rack::Reloader has been rewritten.
256
- * Major update to Rack::Auth::OpenID.
257
- * Support for nested parameter parsing in Rack::Response.
258
- * Support for redirects in Rack::Response.
259
- * HttpOnly cookie support in Rack::Response.
260
- * The Rakefile has been rewritten.
261
- * Many bugfixes and small improvements.
262
-
263
- * October 18th, 2009: Eighth public release 1.0.1.
264
- * Bump remainder of rack.versions.
265
- * Support the pure Ruby FCGI implementation.
266
- * Fix for form names containing "=": split first then unescape components
267
- * Fixes the handling of the filename parameter with semicolons in names.
268
- * Add anchor to nested params parsing regexp to prevent stack overflows
269
- * Use more compatible gzip write api instead of "<<".
270
- * Make sure that Reloader doesn't break when executed via ruby -e
271
- * Make sure WEBrick respects the :Host option
272
- * Many Ruby 1.9 fixes.
273
-
274
- * January 3rd, 2010: Ninth public release 1.1.0.
275
- * Moved Auth::OpenID to rack-contrib.
276
- * SPEC change that relaxes Lint slightly to allow subclasses of the
277
- required types
278
- * SPEC change to document rack.input binary mode in greator detail
279
- * SPEC define optional rack.logger specification
280
- * File servers support X-Cascade header
281
- * Imported Config middleware
282
- * Imported ETag middleware
283
- * Imported Runtime middleware
284
- * Imported Sendfile middleware
285
- * New Logger and NullLogger middlewares
286
- * Added mime type for .ogv and .manifest.
287
- * Don't squeeze PATH_INFO slashes
288
- * Use Content-Type to determine POST params parsing
289
- * Update Rack::Utils::HTTP_STATUS_CODES hash
290
- * Add status code lookup utility
291
- * Response should call #to_i on the status
292
- * Add Request#user_agent
293
- * Request#host knows about forwared host
294
- * Return an empty string for Request#host if HTTP_HOST and
295
- SERVER_NAME are both missing
296
- * Allow MockRequest to accept hash params
297
- * Optimizations to HeaderHash
298
- * Refactored rackup into Rack::Server
299
- * Added Utils.build_nested_query to complement Utils.parse_nested_query
300
- * Added Utils::Multipart.build_multipart to complement
301
- Utils::Multipart.parse_multipart
302
- * Extracted set and delete cookie helpers into Utils so they can be
303
- used outside Response
304
- * Extract parse_query and parse_multipart in Request so subclasses
305
- can change their behavior
306
- * Enforce binary encoding in RewindableInput
307
- * Set correct external_encoding for handlers that don't use RewindableInput
308
-
309
- * June 13th, 2010: Tenth public release 1.2.0.
310
- * Removed Camping adapter: Camping 2.0 supports Rack as-is
311
- * Removed parsing of quoted values
312
- * Add Request.trace? and Request.options?
313
- * Add mime-type for .webm and .htc
314
- * Fix HTTP_X_FORWARDED_FOR
315
- * Various multipart fixes
316
- * Switch test suite to bacon
317
-
318
- * June 15th, 2010: Eleventh public release 1.2.1.
319
- * Make CGI handler rewindable
320
- * Rename spec/ to test/ to not conflict with SPEC on lesser
321
- operating systems
322
-
323
- * March 13th, 2011: Twelfth public release 1.2.2/1.1.2.
324
- * Security fix in Rack::Auth::Digest::MD5: when authenticator
325
- returned nil, permission was granted on empty password.
326
-
327
- * May 22nd, 2011: Thirteenth public release 1.3.0
328
- * Various performance optimizations
329
- * Various multipart fixes
330
- * Various multipart refactors
331
- * Infinite loop fix for multipart
332
- * Test coverage for Rack::Server returns
333
- * Allow files with '..', but not path components that are '..'
334
- * rackup accepts handler-specific options on the command line
335
- * Request#params no longer merges POST into GET (but returns the same)
336
- * Use URI.encode_www_form_component instead. Use core methods for escaping.
337
- * Allow multi-line comments in the config file
338
- * Bug L#94 reported by Nikolai Lugovoi, query parameter unescaping.
339
- * Rack::Response now deletes Content-Length when appropriate
340
- * Rack::Deflater now supports streaming
341
- * Improved Rack::Handler loading and searching
342
- * Support for the PATCH verb
343
- * env['rack.session.options'] now contains session options
344
- * Cookies respect renew
345
- * Session middleware uses SecureRandom.hex
346
-
347
- * May 22nd, 2011: Fourteenth public release 1.2.3
348
- * Pulled in relevant bug fixes from 1.3
349
- * Fixed 1.8.6 support
350
-
351
- * July 13, 2011: Fifteenth public release 1.3.1
352
- * Fix 1.9.1 support
353
- * Fix JRuby support
354
- * Properly handle $KCODE in Rack::Utils.escape
355
- * Make method_missing/respond_to behavior consistent for Rack::Lock,
356
- Rack::Auth::Digest::Request and Rack::Multipart::UploadedFile
357
- * Reenable passing rack.session to session middleware
358
- * Rack::CommonLogger handles streaming responses correctly
359
- * Rack::MockResponse calls close on the body object
360
- * Fix a DOS vector from MRI stdlib backport
361
-
362
- * July 16, 2011: Sixteenth public release 1.3.2
363
- * Fix for Rails and rack-test, Rack::Utils#escape calls to_s
364
-
365
- * September 16, 2011: Seventeenth public release 1.3.3
366
- * Fix bug with broken query parameters in Rack::ShowExceptions
367
- * Rack::Request#cookies no longer swallows exceptions on broken input
368
- * Prevents XSS attacks enabled by bug in Ruby 1.8's regexp engine
369
- * Rack::ConditionalGet handles broken If-Modified-Since helpers
370
-
371
- * September 16, 2011: Eighteenth public release 1.2.4
372
- * Fix a bug with MRI regex engine to prevent XSS by malformed unicode
373
-
374
- * October 1, 2011: Nineteenth public release 1.3.4
375
- * Backport security fix from 1.9.3, also fixes some roundtrip issues in URI
376
- * Small documentation update
377
- * Fix an issue where BodyProxy could cause an infinite recursion
378
- * Add some supporting files for travis-ci
379
-
380
- * October 17, 2011: Twentieth public release 1.3.5
381
- * Fix annoying warnings caused by the backport in 1.3.4
382
-
383
- * December 28th, 2011: Twenty first public release: 1.1.3.
384
- * Security fix. http://www.ocert.org/advisories/ocert-2011-003.html
385
- Further information here: http://jruby.org/2011/12/27/jruby-1-6-5-1
386
-
387
- * December 28th, 2011: Twenty fourth public release 1.4.0
388
- * Ruby 1.8.6 support has officially been dropped. Not all tests pass.
389
- * Raise sane error messages for broken config.ru
390
- * Allow combining run and map in a config.ru
391
- * Rack::ContentType will not set Content-Type for responses without a body
392
- * Status code 205 does not send a response body
393
- * Rack::Response::Helpers will not rely on instance variables
394
- * Rack::Utils.build_query no longer outputs '=' for nil query values
395
- * Various mime types added
396
- * Rack::MockRequest now supports HEAD
397
- * Rack::Directory now supports files that contain RFC3986 reserved chars
398
- * Rack::File now only supports GET and HEAD requests
399
- * Rack::Server#start now passes the block to Rack::Handler::<h>#run
400
- * Rack::Static now supports an index option
401
- * Added the Teapot status code
402
- * rackup now defaults to Thin instead of Mongrel (if installed)
403
- * Support added for HTTP_X_FORWARDED_SCHEME
404
- * Numerous bug fixes, including many fixes for new and alternate rubies
405
-
406
- * January 22nd, 2012: Twenty fifth public release 1.4.1
407
- * Alter the keyspace limit calculations to reduce issues with nested params
408
- * Add a workaround for multipart parsing where files contain unescaped "%"
409
- * Added Rack::Response::Helpers#method_not_allowed? (code 405)
410
- * Rack::File now returns 404 for illegal directory traversals
411
- * Rack::File now returns 405 for illegal methods (non HEAD/GET)
412
- * Rack::Cascade now catches 405 by default, as well as 404
413
- * Cookies missing '--' no longer cause an exception to be raised
414
- * Various style changes and documentation spelling errors
415
- * Rack::BodyProxy always ensures to execute its block
416
- * Additional test coverage around cookies and secrets
417
- * Rack::Session::Cookie can now be supplied either secret or old_secret
418
- * Tests are no longer dependent on set order
419
- * Rack::Static no longer defaults to serving index files
420
- * Rack.release was fixed
421
-
422
- * January 6th, 2013: Twenty sixth public release 1.1.4
423
- * Add warnings when users do not provide a session secret
424
-
425
- * January 6th, 2013: Twenty seventh public release 1.2.6
426
- * Add warnings when users do not provide a session secret
427
- * Fix parsing performance for unquoted filenames
428
-
429
- * January 6th, 2013: Twenty eighth public release 1.3.7
430
- * Add warnings when users do not provide a session secret
431
- * Fix parsing performance for unquoted filenames
432
- * Updated URI backports
433
- * Fix URI backport version matching, and silence constant warnings
434
- * Correct parameter parsing with empty values
435
- * Correct rackup '-I' flag, to allow multiple uses
436
- * Correct rackup pidfile handling
437
- * Report rackup line numbers correctly
438
- * Fix request loops caused by non-stale nonces with time limits
439
- * Fix reloader on Windows
440
- * Prevent infinite recursions from Response#to_ary
441
- * Various middleware better conforms to the body close specification
442
- * Updated language for the body close specification
443
- * Additional notes regarding ECMA escape compatibility issues
444
- * Fix the parsing of multiple ranges in range headers
445
-
446
- * January 6th, 2013: Twenty ninth public release 1.4.2
447
- * Add warnings when users do not provide a session secret
448
- * Fix parsing performance for unquoted filenames
449
- * Updated URI backports
450
- * Fix URI backport version matching, and silence constant warnings
451
- * Correct parameter parsing with empty values
452
- * Correct rackup '-I' flag, to allow multiple uses
453
- * Correct rackup pidfile handling
454
- * Report rackup line numbers correctly
455
- * Fix request loops caused by non-stale nonces with time limits
456
- * Fix reloader on Windows
457
- * Prevent infinite recursions from Response#to_ary
458
- * Various middleware better conforms to the body close specification
459
- * Updated language for the body close specification
460
- * Additional notes regarding ECMA escape compatibility issues
461
- * Fix the parsing of multiple ranges in range headers
462
- * Prevent errors from empty parameter keys
463
- * Added PATCH verb to Rack::Request
464
- * Various documentation updates
465
- * Fix session merge semantics (fixes rack-test)
466
- * Rack::Static :index can now handle multiple directories
467
- * All tests now utilize Rack::Lint (special thanks to Lars Gierth)
468
- * Rack::File cache_control parameter is now deprecated, and removed by 1.5
469
- * Correct Rack::Directory script name escaping
470
- * Rack::Static supports header rules for sophisticated configurations
471
- * Multipart parsing now works without a Content-Length header
472
- * New logos courtesy of Zachary Scott!
473
- * Rack::BodyProxy now explicitly defines #each, useful for C extensions
474
- * Cookies that are not URI escaped no longer cause exceptions
475
-
476
- * January 7th, 2013: Thirtieth public release 1.3.8
477
- * Security: Prevent unbounded reads in large multipart boundaries
478
-
479
- * January 7th, 2013: Thirty first public release 1.4.3
480
- * Security: Prevent unbounded reads in large multipart boundaries
481
-
482
- * January 13th, 2013: Thirty second public release 1.4.4, 1.3.9, 1.2.7, 1.1.5
483
- * [SEC] Rack::Auth::AbstractRequest no longer symbolizes arbitrary strings
484
- * Fixed erroneous test case in the 1.3.x series
485
-
486
- * February 7th, Thirty fifth public release 1.1.6, 1.2.8, 1.3.10
487
- * Fix CVE-2013-0263, timing attack against Rack::Session::Cookie
488
-
489
- * February 7th, Thirty fifth public release 1.4.5
490
- * Fix CVE-2013-0263, timing attack against Rack::Session::Cookie
491
- * Fix CVE-2013-0262, symlink path traversal in Rack::File
492
-
493
- * February 7th, Thirty fifth public release 1.5.2
494
- * Fix CVE-2013-0263, timing attack against Rack::Session::Cookie
495
- * Fix CVE-2013-0262, symlink path traversal in Rack::File
496
- * Add various methods to Session for enhanced Rails compatibility
497
- * Request#trusted_proxy? now only matches whole stirngs
498
- * Add JSON cookie coder, to be default in Rack 1.6+ due to security concerns
499
- * URLMap host matching in environments that don't set the Host header fixed
500
- * Fix a race condition that could result in overwritten pidfiles
501
- * Various documentation additions
151
+ To test Memcache sessions, you need memcached (will be
152
+ run on port 11211) and dalli installed.
153
+
154
+ == Configuration
155
+
156
+ Several parameters can be modified on Rack::Utils to configure \Rack behaviour.
157
+
158
+ e.g:
159
+
160
+ Rack::Utils.key_space_limit = 128
161
+
162
+ === key_space_limit
163
+
164
+ The default number of bytes to allow a single parameter key to take up.
165
+ This helps prevent a rogue client from flooding a Request.
166
+
167
+ Default to 65536 characters (4 kiB in worst case).
168
+
169
+ === multipart_part_limit
170
+
171
+ The maximum number of parts a request can contain.
172
+ Accepting too many part can lead to the server running out of file handles.
173
+
174
+ The default is 128, which means that a single request can't upload more than 128 files at once.
175
+
176
+ Set to 0 for no limit.
177
+
178
+ Can also be set via the +RACK_MULTIPART_PART_LIMIT+ environment variable.
179
+
180
+ == Changelog
181
+
182
+ See {CHANGELOG.md}[https://github.com/rack/rack/blob/master/CHANGELOG.md].
502
183
 
503
184
  == Contact
504
185
 
505
186
  Please post bugs, suggestions and patches to
506
- the bug tracker at <http://github.com/rack/rack/issues>.
187
+ the bug tracker at {issues}[https://github.com/rack/rack/issues].
507
188
 
508
189
  Please post security related bugs and suggestions to the core team at
509
- <https://groups.google.com/group/rack-core> or rack-core@googlegroups.com. Due
510
- to wide usage of the library, it is strongly preferred that we manage timing in
511
- order to provide viable patches at the time of disclosure. Your assistance in
512
- this matter is greatly appreciated.
190
+ <https://groups.google.com/forum/#!forum/rack-core> or rack-core@googlegroups.com. This
191
+ list is not public. Due to wide usage of the library, it is strongly preferred
192
+ that we manage timing in order to provide viable patches at the time of
193
+ disclosure. Your assistance in this matter is greatly appreciated.
513
194
 
514
195
  Mailing list archives are available at
515
- <http://groups.google.com/group/rack-devel>.
196
+ <https://groups.google.com/forum/#!forum/rack-devel>.
516
197
 
517
198
  Git repository (send Git patches to the mailing list):
518
- * http://github.com/rack/rack
199
+
200
+ * https://github.com/rack/rack
519
201
  * http://git.vuxu.org/cgi-bin/gitweb.cgi?p=rack-github.git
520
202
 
521
203
  You are also welcome to join the #rack channel on irc.freenode.net.
522
204
 
523
205
  == Thanks
524
206
 
525
- The Rack Core Team, consisting of
207
+ The \Rack Core Team, consisting of
208
+
209
+ * Leah Neukirchen (leahneukirchen[https://github.com/leahneukirchen])
210
+ * James Tucker (raggi[https://github.com/raggi])
211
+ * Josh Peek (josh[https://github.com/josh])
212
+ * José Valim (josevalim[https://github.com/josevalim])
213
+ * Michael Fellinger (manveru[https://github.com/manveru])
214
+ * Aaron Patterson (tenderlove[https://github.com/tenderlove])
215
+ * Santiago Pastorino (spastorino[https://github.com/spastorino])
216
+ * Konstantin Haase (rkh[https://github.com/rkh])
526
217
 
527
- * Christian Neukirchen (chneukirchen)
528
- * James Tucker (raggi)
529
- * Josh Peek (josh)
530
- * Michael Fellinger (manveru)
531
- * Ryan Tomayko (rtomayko)
532
- * Scytrin dai Kinthra (scytrin)
533
- * Aaron Patterson (tenderlove)
534
- * Konstantin Haase (rkh)
218
+ and the \Rack Alumnis
219
+
220
+ * Ryan Tomayko (rtomayko[https://github.com/rtomayko])
221
+ * Scytrin dai Kinthra (scytrin[https://github.com/scytrin])
535
222
 
536
223
  would like to thank:
537
224
 
@@ -560,37 +247,16 @@ would like to thank:
560
247
  * Alexander Kellett for testing the Gem and reviewing the announcement.
561
248
  * Marcus Rückert, for help with configuring and debugging lighttpd.
562
249
  * The WSGI team for the well-done and documented work they've done and
563
- Rack builds up on.
250
+ \Rack builds up on.
564
251
  * All bug reporters and patch contributors not mentioned above.
565
252
 
566
- == Copyright
567
-
568
- Copyright (C) 2007, 2008, 2009, 2010 Christian Neukirchen <http://purl.org/net/chneukirchen>
569
-
570
- Permission is hereby granted, free of charge, to any person obtaining a copy
571
- of this software and associated documentation files (the "Software"), to
572
- deal in the Software without restriction, including without limitation the
573
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
574
- sell copies of the Software, and to permit persons to whom the Software is
575
- furnished to do so, subject to the following conditions:
576
-
577
- The above copyright notice and this permission notice shall be included in
578
- all copies or substantial portions of the Software.
579
-
580
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
581
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
582
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
583
- THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
584
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
585
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
586
-
587
253
  == Links
588
254
 
589
- Rack:: <http://rack.github.com/>
590
- Official Rack repositories:: <http://github.com/rack>
591
- Rack Bug Tracking:: <http://github.com/rack/rack/issues>
592
- rack-devel mailing list:: <http://groups.google.com/group/rack-devel>
593
- Rack's Rubyforge project:: <http://rubyforge.org/projects/rack>
255
+ \Rack:: <https://rack.github.io/>
256
+ Official \Rack repositories:: <https://github.com/rack>
257
+ \Rack Bug Tracking:: <https://github.com/rack/rack/issues>
258
+ rack-devel mailing list:: <https://groups.google.com/forum/#!forum/rack-devel>
594
259
 
595
- Christian Neukirchen:: <http://chneukirchen.org/>
260
+ == License
596
261
 
262
+ \Rack is released under the {MIT License}[https://opensource.org/licenses/MIT].