rack 1.2.0 → 1.2.1

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 (72) hide show
  1. data/README +5 -0
  2. data/lib/rack/handler/cgi.rb +2 -1
  3. data/lib/rack/utils.rb +10 -5
  4. data/rack.gemspec +3 -3
  5. data/{spec → test}/cgi/lighttpd.conf +0 -0
  6. data/{spec → test}/cgi/rackup_stub.rb +0 -0
  7. data/{spec → test}/cgi/sample_rackup.ru +0 -0
  8. data/{spec → test}/cgi/test +0 -0
  9. data/{spec → test}/cgi/test.fcgi +0 -0
  10. data/{spec → test}/cgi/test.ru +0 -0
  11. data/{spec → test}/multipart/bad_robots +0 -0
  12. data/{spec → test}/multipart/binary +0 -0
  13. data/{spec → test}/multipart/empty +0 -0
  14. data/{spec → test}/multipart/fail_16384_nofile +0 -0
  15. data/{spec → test}/multipart/file1.txt +0 -0
  16. data/{spec → test}/multipart/filename_and_modification_param +0 -0
  17. data/{spec → test}/multipart/filename_with_escaped_quotes +0 -0
  18. data/{spec → test}/multipart/filename_with_escaped_quotes_and_modification_param +0 -0
  19. data/{spec → test}/multipart/filename_with_percent_escaped_quotes +0 -0
  20. data/{spec → test}/multipart/filename_with_unescaped_quotes +0 -0
  21. data/{spec → test}/multipart/ie +0 -0
  22. data/{spec → test}/multipart/nested +0 -0
  23. data/{spec → test}/multipart/none +0 -0
  24. data/{spec → test}/multipart/semicolon +0 -0
  25. data/{spec → test}/multipart/text +0 -0
  26. data/{spec → test}/rackup/config.ru +0 -0
  27. data/{spec → test}/spec_auth_basic.rb +0 -0
  28. data/{spec → test}/spec_auth_digest.rb +0 -0
  29. data/{spec → test}/spec_builder.rb +0 -0
  30. data/{spec → test}/spec_cascade.rb +0 -0
  31. data/{spec → test}/spec_cgi.rb +0 -0
  32. data/{spec → test}/spec_chunked.rb +0 -0
  33. data/{spec → test}/spec_commonlogger.rb +0 -0
  34. data/{spec → test}/spec_conditionalget.rb +0 -0
  35. data/{spec → test}/spec_config.rb +0 -0
  36. data/{spec → test}/spec_content_length.rb +0 -0
  37. data/{spec → test}/spec_content_type.rb +0 -0
  38. data/{spec → test}/spec_deflater.rb +0 -0
  39. data/{spec → test}/spec_directory.rb +0 -0
  40. data/{spec → test}/spec_etag.rb +0 -0
  41. data/{spec → test}/spec_fastcgi.rb +0 -0
  42. data/{spec → test}/spec_file.rb +0 -0
  43. data/{spec → test}/spec_handler.rb +0 -0
  44. data/{spec → test}/spec_head.rb +0 -0
  45. data/{spec → test}/spec_lint.rb +0 -0
  46. data/{spec → test}/spec_lobster.rb +0 -0
  47. data/{spec → test}/spec_lock.rb +0 -0
  48. data/{spec → test}/spec_logger.rb +0 -0
  49. data/{spec → test}/spec_methodoverride.rb +0 -0
  50. data/{spec → test}/spec_mock.rb +0 -0
  51. data/{spec → test}/spec_mongrel.rb +0 -0
  52. data/{spec → test}/spec_nulllogger.rb +0 -0
  53. data/{spec → test}/spec_recursive.rb +0 -0
  54. data/{spec → test}/spec_request.rb +0 -0
  55. data/{spec → test}/spec_response.rb +0 -0
  56. data/{spec → test}/spec_rewindable_input.rb +0 -0
  57. data/{spec → test}/spec_runtime.rb +0 -0
  58. data/{spec → test}/spec_sendfile.rb +0 -0
  59. data/{spec → test}/spec_session_cookie.rb +0 -0
  60. data/{spec → test}/spec_session_memcache.rb +0 -0
  61. data/{spec → test}/spec_session_pool.rb +0 -0
  62. data/{spec → test}/spec_showexceptions.rb +0 -0
  63. data/{spec → test}/spec_showstatus.rb +0 -0
  64. data/{spec → test}/spec_static.rb +0 -0
  65. data/{spec → test}/spec_thin.rb +0 -0
  66. data/{spec → test}/spec_urlmap.rb +0 -0
  67. data/{spec → test}/spec_utils.rb +0 -0
  68. data/{spec → test}/spec_webrick.rb +0 -0
  69. data/{spec → test}/testrequest.rb +0 -0
  70. data/{spec → test}/unregistered_handler/rack/handler/unregistered.rb +0 -0
  71. data/{spec → test}/unregistered_handler/rack/handler/unregistered_long_one.rb +0 -0
  72. metadata +112 -112
data/README CHANGED
@@ -308,6 +308,11 @@ run on port 11211) and memcache-client installed.
308
308
  * Various multipart fixes
309
309
  * Switch test suite to bacon
310
310
 
311
+ * June 15th, 2010: Eleventh public release 1.2.1.
312
+ * Make CGI handler rewindable
313
+ * Rename spec/ to test/ to not conflict with SPEC on lesser
314
+ operating systems
315
+
311
316
  == Contact
312
317
 
313
318
  Please post bugs, suggestions and patches to
@@ -1,4 +1,5 @@
1
1
  require 'rack/content_length'
2
+ require 'rack/rewindable_input'
2
3
 
3
4
  module Rack
4
5
  module Handler
@@ -17,7 +18,7 @@ module Rack
17
18
  env["SCRIPT_NAME"] = "" if env["SCRIPT_NAME"] == "/"
18
19
 
19
20
  env.update({"rack.version" => Rack::VERSION,
20
- "rack.input" => $stdin,
21
+ "rack.input" => Rack::RewindableInput.new($stdin),
21
22
  "rack.errors" => $stderr,
22
23
 
23
24
  "rack.multithread" => false,
@@ -128,13 +128,18 @@ module Rack
128
128
  end
129
129
  module_function :build_nested_query
130
130
 
131
+ ESCAPE_HTML = {
132
+ "&" => "&",
133
+ "<" => "&lt;",
134
+ ">" => "&gt;",
135
+ "'" => "&#39;",
136
+ '"' => "&quot;",
137
+ }
138
+ ESCAPE_HTML_PATTERN = Regexp.union(ESCAPE_HTML.keys)
139
+
131
140
  # Escape ampersands, brackets and quotes to their HTML/XML entities.
132
141
  def escape_html(string)
133
- string.to_s.gsub("&", "&amp;").
134
- gsub("<", "&lt;").
135
- gsub(">", "&gt;").
136
- gsub("'", "&#39;").
137
- gsub('"', "&quot;")
142
+ string.to_s.gsub(ESCAPE_HTML_PATTERN){|c| ESCAPE_HTML[c] }
138
143
  end
139
144
  module_function :escape_html
140
145
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rack"
3
- s.version = "1.2.0"
3
+ s.version = "1.2.1"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.summary = "a modular Ruby webserver interface"
6
6
 
@@ -14,14 +14,14 @@ middleware) into a single method call.
14
14
  Also see http://rack.rubyforge.org.
15
15
  EOF
16
16
 
17
- s.files = Dir['{bin/*,contrib/*,example/*,lib/**/*,spec/**/*}'] +
17
+ s.files = Dir['{bin/*,contrib/*,example/*,lib/**/*,test/**/*}'] +
18
18
  %w(COPYING KNOWN-ISSUES rack.gemspec README SPEC)
19
19
  s.bindir = 'bin'
20
20
  s.executables << 'rackup'
21
21
  s.require_path = 'lib'
22
22
  s.has_rdoc = true
23
23
  s.extra_rdoc_files = ['README', 'SPEC', 'KNOWN-ISSUES']
24
- s.test_files = Dir['spec/spec_*.rb']
24
+ s.test_files = Dir['test/spec_*.rb']
25
25
 
26
26
  s.author = 'Christian Neukirchen'
27
27
  s.email = 'chneukirchen@gmail.com'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 0
9
- version: 1.2.0
8
+ - 1
9
+ version: 1.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Christian Neukirchen
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-13 00:00:00 +02:00
17
+ date: 2010-06-15 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -169,73 +169,73 @@ files:
169
169
  - lib/rack/mime.rb
170
170
  - lib/rack/reloader.rb
171
171
  - lib/rack.rb
172
- - spec/spec_static.rb
173
- - spec/spec_content_type.rb
174
- - spec/spec_thin.rb
175
- - spec/testrequest.rb
176
- - spec/spec_auth_digest.rb
177
- - spec/spec_response.rb
178
- - spec/spec_file.rb
179
- - spec/spec_rewindable_input.rb
180
- - spec/spec_methodoverride.rb
181
- - spec/spec_fastcgi.rb
182
- - spec/spec_chunked.rb
183
- - spec/spec_cgi.rb
184
- - spec/multipart/semicolon
185
- - spec/multipart/filename_with_escaped_quotes
186
- - spec/multipart/binary
187
- - spec/multipart/fail_16384_nofile
188
- - spec/multipart/filename_and_modification_param
189
- - spec/multipart/text
190
- - spec/multipart/ie
191
- - spec/multipart/filename_with_percent_escaped_quotes
192
- - spec/multipart/empty
193
- - spec/multipart/none
194
- - spec/multipart/file1.txt
195
- - spec/multipart/filename_with_escaped_quotes_and_modification_param
196
- - spec/multipart/nested
197
- - spec/multipart/bad_robots
198
- - spec/multipart/filename_with_unescaped_quotes
199
- - spec/spec_head.rb
200
- - spec/spec_urlmap.rb
201
- - spec/spec_mongrel.rb
202
- - spec/spec_content_length.rb
203
- - spec/spec_session_cookie.rb
204
- - spec/spec_utils.rb
205
- - spec/spec_showexceptions.rb
206
- - spec/spec_lobster.rb
207
- - spec/spec_logger.rb
208
- - spec/spec_sendfile.rb
209
- - spec/spec_conditionalget.rb
210
- - spec/spec_lint.rb
211
- - spec/spec_deflater.rb
212
- - spec/rackup/config.ru
213
- - spec/spec_showstatus.rb
214
- - spec/spec_lock.rb
215
- - spec/spec_nulllogger.rb
216
- - spec/spec_config.rb
217
- - spec/spec_session_memcache.rb
218
- - spec/spec_runtime.rb
219
- - spec/spec_commonlogger.rb
220
- - spec/spec_directory.rb
221
- - spec/spec_cascade.rb
222
- - spec/spec_webrick.rb
223
- - spec/spec_request.rb
224
- - spec/spec_etag.rb
225
- - spec/spec_mock.rb
226
- - spec/cgi/sample_rackup.ru
227
- - spec/cgi/test
228
- - spec/cgi/test.fcgi
229
- - spec/cgi/lighttpd.conf
230
- - spec/cgi/rackup_stub.rb
231
- - spec/cgi/test.ru
232
- - spec/spec_builder.rb
233
- - spec/spec_auth_basic.rb
234
- - spec/unregistered_handler/rack/handler/unregistered.rb
235
- - spec/unregistered_handler/rack/handler/unregistered_long_one.rb
236
- - spec/spec_handler.rb
237
- - spec/spec_session_pool.rb
238
- - spec/spec_recursive.rb
172
+ - test/spec_static.rb
173
+ - test/spec_content_type.rb
174
+ - test/spec_thin.rb
175
+ - test/testrequest.rb
176
+ - test/spec_auth_digest.rb
177
+ - test/spec_response.rb
178
+ - test/spec_file.rb
179
+ - test/spec_rewindable_input.rb
180
+ - test/spec_methodoverride.rb
181
+ - test/spec_fastcgi.rb
182
+ - test/spec_chunked.rb
183
+ - test/spec_cgi.rb
184
+ - test/multipart/semicolon
185
+ - test/multipart/filename_with_escaped_quotes
186
+ - test/multipart/binary
187
+ - test/multipart/fail_16384_nofile
188
+ - test/multipart/filename_and_modification_param
189
+ - test/multipart/text
190
+ - test/multipart/ie
191
+ - test/multipart/filename_with_percent_escaped_quotes
192
+ - test/multipart/empty
193
+ - test/multipart/none
194
+ - test/multipart/file1.txt
195
+ - test/multipart/filename_with_escaped_quotes_and_modification_param
196
+ - test/multipart/nested
197
+ - test/multipart/bad_robots
198
+ - test/multipart/filename_with_unescaped_quotes
199
+ - test/spec_head.rb
200
+ - test/spec_urlmap.rb
201
+ - test/spec_mongrel.rb
202
+ - test/spec_content_length.rb
203
+ - test/spec_session_cookie.rb
204
+ - test/spec_utils.rb
205
+ - test/spec_showexceptions.rb
206
+ - test/spec_lobster.rb
207
+ - test/spec_logger.rb
208
+ - test/spec_sendfile.rb
209
+ - test/spec_conditionalget.rb
210
+ - test/spec_lint.rb
211
+ - test/spec_deflater.rb
212
+ - test/rackup/config.ru
213
+ - test/spec_showstatus.rb
214
+ - test/spec_lock.rb
215
+ - test/spec_nulllogger.rb
216
+ - test/spec_config.rb
217
+ - test/spec_session_memcache.rb
218
+ - test/spec_runtime.rb
219
+ - test/spec_commonlogger.rb
220
+ - test/spec_directory.rb
221
+ - test/spec_cascade.rb
222
+ - test/spec_webrick.rb
223
+ - test/spec_request.rb
224
+ - test/spec_etag.rb
225
+ - test/spec_mock.rb
226
+ - test/cgi/sample_rackup.ru
227
+ - test/cgi/test
228
+ - test/cgi/test.fcgi
229
+ - test/cgi/lighttpd.conf
230
+ - test/cgi/rackup_stub.rb
231
+ - test/cgi/test.ru
232
+ - test/spec_builder.rb
233
+ - test/spec_auth_basic.rb
234
+ - test/unregistered_handler/rack/handler/unregistered.rb
235
+ - test/unregistered_handler/rack/handler/unregistered_long_one.rb
236
+ - test/spec_handler.rb
237
+ - test/spec_session_pool.rb
238
+ - test/spec_recursive.rb
239
239
  - COPYING
240
240
  - KNOWN-ISSUES
241
241
  - rack.gemspec
@@ -272,45 +272,45 @@ signing_key:
272
272
  specification_version: 3
273
273
  summary: a modular Ruby webserver interface
274
274
  test_files:
275
- - spec/spec_static.rb
276
- - spec/spec_content_type.rb
277
- - spec/spec_thin.rb
278
- - spec/spec_auth_digest.rb
279
- - spec/spec_response.rb
280
- - spec/spec_file.rb
281
- - spec/spec_rewindable_input.rb
282
- - spec/spec_methodoverride.rb
283
- - spec/spec_fastcgi.rb
284
- - spec/spec_chunked.rb
285
- - spec/spec_cgi.rb
286
- - spec/spec_head.rb
287
- - spec/spec_urlmap.rb
288
- - spec/spec_mongrel.rb
289
- - spec/spec_content_length.rb
290
- - spec/spec_session_cookie.rb
291
- - spec/spec_utils.rb
292
- - spec/spec_showexceptions.rb
293
- - spec/spec_lobster.rb
294
- - spec/spec_logger.rb
295
- - spec/spec_sendfile.rb
296
- - spec/spec_conditionalget.rb
297
- - spec/spec_lint.rb
298
- - spec/spec_deflater.rb
299
- - spec/spec_showstatus.rb
300
- - spec/spec_lock.rb
301
- - spec/spec_nulllogger.rb
302
- - spec/spec_config.rb
303
- - spec/spec_session_memcache.rb
304
- - spec/spec_runtime.rb
305
- - spec/spec_commonlogger.rb
306
- - spec/spec_directory.rb
307
- - spec/spec_cascade.rb
308
- - spec/spec_webrick.rb
309
- - spec/spec_request.rb
310
- - spec/spec_etag.rb
311
- - spec/spec_mock.rb
312
- - spec/spec_builder.rb
313
- - spec/spec_auth_basic.rb
314
- - spec/spec_handler.rb
315
- - spec/spec_session_pool.rb
316
- - spec/spec_recursive.rb
275
+ - test/spec_static.rb
276
+ - test/spec_content_type.rb
277
+ - test/spec_thin.rb
278
+ - test/spec_auth_digest.rb
279
+ - test/spec_response.rb
280
+ - test/spec_file.rb
281
+ - test/spec_rewindable_input.rb
282
+ - test/spec_methodoverride.rb
283
+ - test/spec_fastcgi.rb
284
+ - test/spec_chunked.rb
285
+ - test/spec_cgi.rb
286
+ - test/spec_head.rb
287
+ - test/spec_urlmap.rb
288
+ - test/spec_mongrel.rb
289
+ - test/spec_content_length.rb
290
+ - test/spec_session_cookie.rb
291
+ - test/spec_utils.rb
292
+ - test/spec_showexceptions.rb
293
+ - test/spec_lobster.rb
294
+ - test/spec_logger.rb
295
+ - test/spec_sendfile.rb
296
+ - test/spec_conditionalget.rb
297
+ - test/spec_lint.rb
298
+ - test/spec_deflater.rb
299
+ - test/spec_showstatus.rb
300
+ - test/spec_lock.rb
301
+ - test/spec_nulllogger.rb
302
+ - test/spec_config.rb
303
+ - test/spec_session_memcache.rb
304
+ - test/spec_runtime.rb
305
+ - test/spec_commonlogger.rb
306
+ - test/spec_directory.rb
307
+ - test/spec_cascade.rb
308
+ - test/spec_webrick.rb
309
+ - test/spec_request.rb
310
+ - test/spec_etag.rb
311
+ - test/spec_mock.rb
312
+ - test/spec_builder.rb
313
+ - test/spec_auth_basic.rb
314
+ - test/spec_handler.rb
315
+ - test/spec_session_pool.rb
316
+ - test/spec_recursive.rb