summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1745 from ioquatix/streamingmasterAaron Patterson2022-01-204-698/+856
|\ | | | | Support callable body for explicit streaming support.
| * Introduce Streaming Body specification.Samuel Williams2022-01-204-73/+229
| |
| * Prefer to use wrapper class for `Rack::Lint`.Samuel Williams2022-01-201-679/+681
| |
* | Prefer `filename*` over `filename` when processing multipart data.chiwenchen2022-01-213-3/+15
| |
* | deflater.rb - optimize GzipStream#eachMSP-Greg2022-01-201-8/+18
|/
* Move RuboCop to optional maintenance group.Samuel Williams2022-01-201-2/+5
|
* Remove obsolete support for RFC2109 date/time formatting.Samuel Williams2022-01-152-19/+0
|
* Test with latest version of psych.Samuel Williams2022-01-154-26/+22
|
* Fix reference to SPEC in README (Fixes #1782)Jeremy Evans2021-11-301-1/+1
|
* Update trusted_proxy? to match on 127.0.0.0/8 (#1781)Steven Bloch2021-11-293-1/+32
|
* Allow to daemonize without closing STDOUT/STDERR (#1779)Stephen Paul Weber2021-11-061-2/+7
| | | | | Useful for redirecting these to files for logging, etc. Closes #1775
* Mark `ETag` change in 2.2.0 as breaking (#1778)Patrik Ragnarsson2021-11-041-1/+1
| | | | | Close #1731 [ci skip]
* Update CHANGELOG for 2.0.9 (Fixes #1767)Jeremy Evans2021-11-031-0/+6
|
* Add Rack::Session::Pool :allow_fallback optionJeremy Evans2021-11-033-2/+20
| | | | | | | | | | | | This fixes a theoretical security issue where a lookup of the session ID uses a non-constant time algorithm (such as a database index), and only for cases where there is a session that existed prior to an rack version that added support for private session IDs. This defaults :allow_fallback to true for backwards compatibility, but we may want to make the default false in Rack 3. Fixes #1431
* remove changelog message as it has no effect on the end userAaron Rosenberg2021-11-031-1/+0
|
* Set @env directly to avoid unneeded call maintained for extensibilityAaron Rosenberg2021-11-032-3/+2
|
* Revert "Remove unnecessary call to `super()`"Aaron Rosenberg2021-11-032-2/+5
| | | | | This reverts commit b050e742ca7c8cd26987e1d3d975671e2b221b88. Annotate `super()` call that started this whole adventure.
* Revert "Flatten Rack::Request::Env into Request"Aaron Rosenberg2021-11-032-51/+58
| | | | This reverts commit d96b5c39fd32aa8f8b1b694470a0f78f4a7475fe.
* Update documentation for Rack::HandlerKS2021-10-191-2/+1
|
* Merge pull request #1752 from learnlifecom/mock-hash-with-array-valuesAaron Patterson2021-10-042-12/+23
|\ | | | | Fix MockRequest cookie parsing for hash with array value
| * Fix MockRequest cookie parsing for hash with array valueRobin Bortlik2021-05-282-12/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `Rack::Response.new` allows to set multiple cookies just by passing hash with key 'Set-Cookie' and value as an array containing cookies we want to set. example: ```ruby Rack::Response.new( [ "Authentication failed" ], 401, { "Content-type" => "text/error", "Set-Cookie" => ["foo=bar", "baz=ban"] } ) ``` Unfortunately `MockRequest` class is not able to parse such definition of cookies as it expects cookie value to be always a string. Solution: Wrap every cookie value to `Array()` which converts string values to array. So we can safely iterate over the values. In case the value is already an array it simply return it.
* | Remove an example that passes options on the first `#\` line [ci skip]yuuji.yaginuma2021-07-131-2/+0
| | | | | | | | This feature was deprecated since #1574.
* | Remove unnecessary call to `super()` in `Rack::Request::Env` (#1751)Aaron Rosenberg2021-06-052-57/+51
|/ | | | | * Remove unnecessary call to `super()` * Flatten Rack::Request::Env into Request
* Add AWS Lambda Supported "Web Server".Ken Collins2021-05-171-0/+1
|
* Update year in license fileKonstantin Haase2021-05-061-1/+1
| | | [ci skip]
* Merge pull request #1747 from kamipo/fix_typosKonstantin Haase2021-05-063-4/+4
|\ | | | | Fix some typos [ci skip]
| * Fix some typos [ci skip]Ryuta Kamizono2021-04-263-4/+4
| |
* | Merge pull request #1748 from wjordan/to_ary-bufferedAaron Patterson2021-05-057-53/+180
|\ \ | | | | | | Clarify streaming response body behavior in SPEC
| * | Add spec changes to `Rack::Lint`Will Jordan2021-04-273-23/+165
| | | | | | | | | | | | | | | | | | | | | | | | Added the following Lint errors: - "Middleware must not call #each directly" - "New body must yield at least once per iteration of old body" - "Body has not been closed" - "#to_ary not identical to contents produced by calling #each"
| * | Use :to_ary to detect non-streaming body content in middlewareWill Jordan2021-04-264-34/+15
| | | | | | | | | | | | Apply to `ContentLength` and `ETag` middleware.
| * | Update SPEC to clarify streaming response body behaviorWill Jordan2021-04-261-0/+4
| |/ | | | | | | | | | | Strings must be processed individually as they are yielded by `each`. However, if the Body responds to `to_ary` it can be implicitly coerced to an Array, which may then be processed all at once.
* | Read the pid file only onceKatsuhiko YOSHIDA2021-04-302-20/+24
| |
* | Output the pid if the server is already runningKatsuhiko YOSHIDA2021-04-302-5/+4
|/
* Make tests pass on hosts that have no ipv4 connectivityAntonio Terceiro2021-04-192-13/+13
| | | | | | | | | | | | | | Hosts with no ipv4 connectivity are going to be increasingly common in the future. In such hosts, one will see errors like the following when running the rack tests: Errno::EADDRNOTAVAIL: Cannot assign requested address - bind(2) for 127.0.0.1:9210 Binding to localhost instead of explicitly to 127.0.0.1 solves the problem - `localhost` is resolved to all _available_ local addresses and those are used. Client connections need to do the same, and it all just works regardless of the local networking stack.
* Allow ws and wss as forwarded scheme/proto headersErwan Thomas2021-04-153-1/+18
| | | | | | | This change improves SSL detection in apps running behind some reverse-proxies. Fixes #1730
* pluralize the headers variable in the common loggerJon foster2021-03-301-2/+2
|
* CI: Workaround YAML gotcha in ActionsPatrik Ragnarsson2021-03-151-1/+1
| | | | | | | To avoid unexpectedly stop testing Ruby 3.0 when Ruby 3.1 is released. See https://github.com/actions/runner/issues/849 At https://github.com/rack/rack/runs/2041788658?check_suite_focus=true#step:3:3 we can see that the setup-ruby action ran with just `3` as the input and not `3.0`.
* Fix generation of multipart filename with space.Muir Manders2021-03-054-2/+20
| | | | | | | | | The multipart generator was escaping filenames using Rack::Utils.escape, but the parser was using Rack::Utils.unescape_path. If the file name contained spaces such as "foo bar.txt", escape would encode as "foo+bar.txt" and then unescape_path would decode to "foo+bar.txt", incorrectly leaving the plus sign. Fix by changing the generator to use escape_path to match the parser.
* Use more descriptive argument nameJeremy Evans2021-01-211-4/+4
|
* Default to & as separator instead of either & or ;Jeremy Evans2021-01-214-9/+12
| | | | | | Allowing ; as separator by default can lead to web cache poisoning. Fixes #1732
* Ruby 3 (#1727)Ben Fritsch2021-01-052-1/+2
|
* Freeze Rack::VERSION (#1726)Kir Shatrov2020-12-281-2/+3
|
* Fix inefficient assert pattern in Rack::Lint (#1724)Benoit Daloze2020-12-091-196/+179
| | | | | | | | | | | | * Use `raise "message" unless condition` instead of assert in Rack::Lint * The existing #assert is very inefficient because it computes the error message string even if no error is raised. * Fixes https://github.com/rack/rack/issues/1723 * Deprecate Rack::Lint::Assertion#assert * No need to include the Assertion module anymore in lint.rb
* Make Rack::MockResponse handle non-hash headersJeremy Evans2020-12-013-3/+25
| | | | | | | | | | | | | | | Rack::MockResponse inherits from Rack::Response, which already uses a HeaderHash for the headers. The original_headers were only used for cookie parsing, which for some reason was happening before the call to super in initialize (so the headers weren't available yet). There seems to be no reason why the cookie parsing can't happen after the call to super, in which case we can use the headers directly. Fixes #1629 Fixes #1630 Co-authored-by: Matt Palmer <mpalmer@hezmatt.org>
* Merge pull request #1719 from tlatsas/skip-rubocop-for-external-testsSamuel Williams2020-11-151-1/+1
|\ | | | | Skip rubocop for external tests
| * Skip rubocop for external testsTasos Latsas2020-11-141-1/+1
|/
* Use faster OpenSSL secure_compare if availableBart de Water2020-11-132-6/+15
| | | | | | Comparing a 16 byte string: openssl_secure_compare: 9397508.4 i/s rack_secure_compare: 515938.0 i/s - 18.21x (± 0.00) slower
* Fix warningkvokka2020-11-041-1/+1
| | | | | | | | | Running specs against JRuby 9.2.13.0 got the warning: ``` /Users/mike/.asdf/installs/ruby/jruby-9.2.13.0/lib/ruby/gems/shared/gems/rack-2.2.3/lib/rack/media_type.rb:18: warning: `&' interpreted as argument prefix ``` This PR should fix it.
* Remove thin specJeremy Evans2020-10-211-98/+0
| | | | | | Support for thin was removed earlier, so no reason to keep this. Fixes #1714
* use @status instead of status.to_iceclinux2020-09-241-1/+1
|