Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rack/rack
...
head fork: rack/rack
Checking mergeability… Don't worry, you can still create the pull request.
Commits on Feb 08, 2013
@novemberborn novemberborn Validate header names according to RFC 2616
Header name validation rules are too strict. RFC 2616 allows any ASCII character save from 0-32, 127, "(", ")", "<", ">", "@", ",", ";", ":", "\", <">, "/", "[", "]", "?", "=" and "{", "}".
facb3a6
Commits on Jan 15, 2014
@jakubpawlowicz jakubpawlowicz Adds improved Rack::Deflater tests. 8e52002
@jakubpawlowicz jakubpawlowicz Adds deflater options to control compression on per-request level.
* Adds :if option which should be given a lambda accepting env, status, headers, and body options.
* When :if evaluates to false a response body won't be compressed.
* Adds :include option which should be given an array of compressible content types.
* When :include don't include request's content type then response body won't be compressed.
3ae2f30
Commits on Jan 18, 2014
@KitaitiMakoto KitaitiMakoto Close body if content is fresh enough adc2169
Commits on Jan 20, 2014
@ArtemPyanykh ArtemPyanykh Reformat Rack::Lint docs.
Limit lines to 80 chars.
05c96e7
Commits on Feb 13, 2014
@jodosha jodosha Ensure Rack::Utils.best_q_match to respect requested content type e06a254
Commits on Feb 14, 2014
@graysonwright graysonwright Flip the lobster better 464888a
Commits on Feb 23, 2014
@vipulnsward vipulnsward Change from `ruby-fcgi` to `fcgi` which is for fcgi tests, since it i…
…s better maintained version.
f44cf00
Commits on Feb 24, 2014
@spastorino spastorino Merge pull request #661 from vipulnsward/change-fcgi-dependency
Change from `ruby-fcgi` to `fcgi`.
5aff4ca
Commits on Feb 25, 2014
@johanlunds johanlunds Remove outdated comment in request.rb about instance-memoization
* Removed memoization in: 0bf8d8e
* Added memoization + comment in: eefbed8
7e47ff9
Commits on Feb 26, 2014
@spastorino spastorino Merge pull request #662 from johanlunds/patch-1
Cleanup: Remove outdated comment in request.rb about instance-memoization
2c0297a
Commits on Feb 27, 2014
@wppurking wppurking small fix about format c2a4306
@spastorino spastorino Merge pull request #663 from wppurking/patch-1
small fix about format
ce4a395
Commits on Mar 08, 2014
@mattkasa mattkasa Add support for RFC2324 status code 7fe910e
@mattkasa mattkasa Add helper method for 418 d71053f
Commits on Mar 25, 2014
@alindeman alindeman request.scheme supports multiple x-http-forwarded-proto values c5ffa93
Commits on Apr 10, 2014
@keithduncan keithduncan Fix `clean_path_info` for paths with only a slash 430892c
Commits on Apr 13, 2014
@KitaitiMakoto KitaitiMakoto Proxy body if it is fresh enough
In order to prevent response body resulting in race conditions.
6aa56de
Commits on May 14, 2014
@ssoroka ssoroka add support for application/json content type requests d8e2e2a
Commits on May 17, 2014
@dwilkie dwilkie Refactor methodoverride to make it easier to inherit and extend 7dcdcc8
Commits on May 19, 2014
@spastorino spastorino Merge pull request #687 from dwilkie/master
Refactor methodoverride to make it easier to inherit and extend
b2e074c
Commits on May 20, 2014
@spastorino spastorino Move ["POST"] to a constant 93e7d7a
Commits on Jun 12, 2014
@MichalBryxi MichalBryxi max-age settings forces Set-Cookie parameter
With patch 74e0acd, there is ability on rack to set max-age parameter. Which is fine. Unfortunately this parameter is sent to browser only when the session cookie is created. Which is afaik wrong. You usually want to refresh the cookie with each page request. And setting 'expires' parameter behaves in this way as well. So this patch doest:

1) When max-age parameter is present, the Set-Cookie HTTP header is sent with each request
2) When both max-age and expires parameter are set, max-age has precedence
3) Added max-age conversion to string where aplicable, because user might not want to use string for "time interval"
241ce2d
Commits on Jun 16, 2014
@IvanUkhov IvanUkhov Fixed build_nested_query to handle empty arrays and hashes d77bd3f
Commits on Jun 19, 2014
@espadrine espadrine Readme: Use an SVG badge.
Badges will look more consistent and less blurry on Retina screens (and the like).
2bc59be
Commits on Jun 23, 2014
@rkh rkh Merge pull request #700 from espadrine/patch-1
Readme: Use an SVG badge.
606daec
Commits on Jun 28, 2014
@lengarvey lengarvey Fix spec_request on ruby-trunk (2.2.0dev)
Manually percent-encode square brackets in query string. This fixes
current travis build issues.

2.2.0dev has recently changed URI parsing from RFC2396 to RFC3986.
Square brackets in RFC3986 are required to be percent-encoded when
present in the query string of a URI. URI.encode on 2.2.0dev isn't
currently updated to support this encoding (see:
    https://bugs.ruby-lang.org/issues/9990)
c8aaf0b
Commits on Jun 30, 2014
@davidcelis davidcelis Fix AccessLog documentation typo 925201c
Commits on Jul 05, 2014
@raggi raggi Merge pull request #709 from davidcelis/patch-1
Fix AccessLog documentation typo
f8473aa
@raggi raggi Merge pull request #708 from lengarvey/fix_uri_encoding_ruby_220_rfc3986
Fix spec_request on ruby-trunk (2.2.0dev)
5081956
@raggi raggi Monkey patch to fix WEBrick chunking semantics.
 * Previously proposed in #707, unfortunately that patch caused double encoding
 * Fixes #707, #618
 * The longevity of this patch is dubious. If WEBrick makes identical semantics
   modifications as I think should be done, this patch will have no effect. If
   WEBrick introduces changes to internal header handling, class structure, etc,
   we'll break.
f2cbe32
@raggi raggi Merge pull request #667 from mattkasa/feature/add_rfc2324_status_code
Add support for RFC2324
370e34a
@raggi raggi Merge pull request #660 from graysonwright/better_lobster_flip
Flip the lobster better
f5dc46a
@raggi raggi Merge pull request #659 from jodosha/utils-best_q_match-respect-conte…
…nt-type

Ensure Rack::Utils.best_q_match to respect requested content type
186e256
Commits on Jul 06, 2014
@raggi raggi Merge pull request #648 from ArtemPyanykh/lint-doc-formatting
Reformat Rack::Lint docs.
cfd173b
@raggi raggi Merge pull request #646 from KitaitiMakoto/close-body-when-fresh
Close body if content is fresh enough
1b2fb3c
@keithduncan keithduncan Rename clean slash only test c2564e3
@raggi raggi Rack::Utils#best_q_match returns nil with no match 4da6ef9
@raggi raggi Merge pull request #675 from keithduncan/fix-clean-path-for-slash
Fix `clean_path_info` for paths with only a slash
72f58e6
Commits on Jul 08, 2014
@MichalBryxi MichalBryxi Fixed stray return 75c68e6
@tenderlove tenderlove use RFC 2396 URI parser in the mock object
this fixes `env_for` on ruby trunk
64a2862
Commits on Jul 11, 2014
@stevehodgkiss stevehodgkiss Prevent IP spoofing via X-Forwarded-For and Client-IP headers
By specifying the same IP in X-Forwarded-For and Client-IP an attacker is able to easily spoof the value of `request.ip`, unless a trusted proxy is configured to remove any user supplied Client-IP headers. The value of request.ip should be the value after the last trusted proxy IP in X-Forwarded-For (from right to left).
7a8efc2
Commits on Jul 13, 2014
@raggi raggi Do not truncate POST data on `;`, closes #543
It appears Rack has been doing this for years. It's not correct behavior for any
generators that I can remember. It comes from the cookie parsing code.
71c6911
@bestie bestie ShowException only serves HTML Accept header contains text/html
Rather than be concerned with whether a request is an asynchronous browser
request or not it is better to simply consider the Accept header and only serve
HTML to clients that specifically ask for it.

This way you will not find your pure JSON API application splitting out HTML
error messages to your console when using curl :)
2ab24cf
@bestie bestie ShowExceptions minor refactoring
* Load HTML exception template only if needed
* Only #call is public
* Enumerable body concern in one place
893a2c5
@bestie bestie Restore public API b8cb4d1
@bestie bestie Undo template refactoring
As this is orthoganol to HTML rendering change.
ce99c0d
@raggi raggi Flip to best_q_match, so we provide html to */* 01428fe
@raggi raggi correct typo and refactor tests for coverage
Closes #592
6f1a4a4
@raggi raggi Gracefully handle cycles in parameters
Might close 632, pending more information.
b3e7a7c
@raggi raggi Merge pull request #705 from stevehodgkiss/fix_ip_spoofing_vulnerability
Prevent IP spoofing via X-Forwarded-For and Client-IP headers
6c767f4
@raggi raggi Fix showexceptions specs on 1.8. Need travis back. e8ba98b
@raggi raggi Fix cycle tests on 1.8.7 4582f34
@raggi raggi Fix URI parsing on 1.8.7, also address perf f467f1b
@mcantor mcantor whitespace 7d20fa6
@mcantor mcantor Give @middleware a more semantic name.
Had to put the class method definitions in an eigenclass wrapper
to use the 'alias' keyword sanely. It wouldn't be necessary if
old behavior of the middleware was unsupported, but that would be
too invasive for just a small clarity change.
52a80a7
@mcantor mcantor Simplify default middleware construction.
- Removed concat, the DRYness isn't worth the loss of clarity.
- Removed ||=, no need to memoize such a small operation.
- Removed the array-default hash usage; if this behavior is supported,
  we should add a test for it.
704be37
@raggi raggi remove incorrect comment in PR 706 a11a76e
Commits on Jul 14, 2014
@raggi raggi ParameterTypeError for parse_nested_query
Inherits from TypeError, so existing code that checks types by is_a? and friends
should still work fine. This should enable users to be more confident that they
are only catching this error case, not other exceptional conditions.

Closes #524
167b648
Commits on Jul 15, 2014
Eric Wong README: update to add yahns to the list of servers
yahns will eventually support more than Rack, but for now
it only knows Rack.

ref: http://yahns.yhbt.net/README
Signed-off-by: James Tucker <jftucker@gmail.com>
c25dede
Eric Wong builder: avoid to_app on every request when using map
By calling to_app immediately after initializing the per-map
Rack::Builder instances.  Otherwise, benefits of warmup and web
servers taking advantage of CoW are lost.

This passes tests, and is lightly tested and I have not verified
this for any negative consequences or incompatibilities.

Signed-off-by: James Tucker <jftucker@gmail.com>
b51f303
Eric Wong chunked: do not chunk on pre-HTTP/1.0 clients
Ancient HTTP clients which predate HTTP/1.0 may not set HTTP_VERSION
at all, and those do not support chunking.

RFC 1945 describes HTTP/0.9 as well as HTTP/1.0

Signed-off-by: James Tucker <jftucker@gmail.com>
895beec
@lenny lenny Record Tempfiles from multipart form data in env[rack.tempfiles]
To facilitate cleanup without depending on garbage collection.
2f3d665
@lenny lenny Rack::TempfileReaper
  - should do nothing (i.e. not bomb out) without env[rack.tempfiles]
  - should close env[rack.tempfiles] when body is closed
  - should initialize env[rack.tempfiles] when not already present
  - should append env[rack.tempfiles] when already present
ee0e35d
@lenny lenny Enable cleanup of Tempfiles from multipart form data by default ccc542f
@spastorino spastorino Use latest 2.1 on Travis b0a19a2
@spastorino spastorino Fix rbx settings for Travis d2e4293
@spastorino spastorino Remove rbx from Travis' allow_failures 4a02ece
Commits on Jul 18, 2014
@rafaelfranca rafaelfranca default_middleware_by_environment should always returns empty array f…
…or unknown keys

The current behaviour break rails server for any environment different
of development.

This behaviour was removed at 704be37 with a warning that if this
behavior is supported tests need to be added. The tests are already
there and they were not failing because "none" environment were added to
the hash. This environment is not a valid environment and it is on the
tests exactly to assert the behaviour that
default_middleware_by_environment always return an empty array for
unknown keys.
f667205
@tenderlove tenderlove Merge pull request #712 from rafaelfranca/rm-fix-rails-server
default_middleware_by_environment should always returns empty array for unknown keys
4b8e2ed
@raggi raggi Undo test that falsely exemplifies production env 96fd002
@raggi raggi Merge pull request #710 from rack/webrick-chunking
Monkey patch to fix WEBrick chunking semantics.
af68941
@raggi raggi multipart content-type match now case insensitive
Closes #676

This may not be 100% to spec, but it is important for compatibility and should
not cause regressions.
1aff92c
@raggi raggi Rack::Multipart::UploadedFile has file extensions
Tempfiles created for file uploads now have file extensions. This enables
certain use cases for users that are using file extensions as heuristics.

Closes #690
2683d27
@rafaelfranca rafaelfranca Fix media_type_params when Content-Type parameters contains quoted-st…
…rings

According RFC 2616, the Content-Type parameters value can be even a token or
a quoted-string:

    media-type     = type "/" subtype *( ";" parameter )
    type           = token
    subtype        = token
    parameter      = attribute "=" value
    attribute      = token
    value          = token | quoted-string
    quoted-string  = ( <"> *(qdtext | quoted-pair ) <"> )
    qdtext         = <any TEXT except <">>"
    quoted-pair    = "\" CHAR
28ba782
@rafaelfranca rafaelfranca Raise specific exception if the parameters are invalid
There are some cases where we try to parse the parameters but it fails
with ArgumentError.

1. When the parameters come from the query string and contains invalid
UTF-8 characters. In this case we raise ArgumentError when trying to
match the key portion of parameters with a regexp.

2. When the parameters come from the request body and the query string
contains invalid % encoded string. In this case we raise ArgumentError
when calling URI.decode_www_form_component.

Now both cases raise a InvalidParameterError what inherit from TypeError
and we can catch this exception to show a bad request for users instead
of an internal server error.
586cfba
@tenderlove tenderlove Merge pull request #713 from rafaelfranca/raise-on-invalid-charset
Raise specific exception if the parameters are invalid
cc8279f
@tenderlove tenderlove Merge pull request #714 from rafaelfranca/rm-fix-media-type-params
Fix media_type_params when Content-Type parameters contains quoted-strings
d1f32cd
@raggi raggi UrlMap: Enable case-insensitive domain matching
Closes #668.
Supersedes #668, because it dropped port matching.
2754224
@raggi raggi correct weird case regression from #714 837b0e6
@raggi raggi Fix parent type API regression introduced in #713 975ccac
@raggi raggi multipart/form-data with files with no input name
Closes #695.

This is not technically specification correct, but it is included for
compatibility with bad clients.
83155c5
@raggi raggi support empty string multipart filename
Closes #702.

Enables support for IE11.
9269d22
Commits on Jul 19, 2014
@ujifgc ujifgc add quiet mode of rack server, rackup --quiet 9f0aa92
Commits on Jul 20, 2014
@raggi raggi Revert "support empty string multipart filename"
This reverts commit 9269d22.
5a9ffeb
Commits on Aug 01, 2014
Fran Casas Implement full Logger interface on NullLogger
NullLogger implements only a small subset of the Logger public
interface. In case you need to hack with your loggers a bit more than
usual the NullLogger is useless since it will raise NoMethodError all
the time.
9a92526
Commits on Aug 03, 2014
@raggi raggi Fix yet another body close bug in Rack::Deflater 0f8cd05
@raggi raggi Rack::ETag correctly marks etags as Weak
Closes #681.
12528d4
@raggi raggi Merge pull request #457 from jakubpawlowicz/master
Configuration options for Rack::Deflate
62dcc83
@raggi raggi Merge pull request #717 from franciscoj/full-logger-interface
Implement full Logger interface on NullLogger
60a25f2
@raggi raggi Merge pull request #698 from IvanUkhov/build-query-empty-arrays
Utils.build_nested_query to handle empty arrays and hashes
6ee42d6
@raggi raggi build_nested_query includes integer values
Patch from @spastorino
Closes #557
c34b579
@raggi raggi Merge branch 'spastorino'
* spastorino:
  build_nested_query includes integer values

Conflicts:
	lib/rack/utils.rb
33075a4
@raggi raggi Merge pull request #697 from MichalBryxi/max_age
max-age settings forces Set-Cookie parameter
d8e34e9
@raggi raggi Merge branch 'master' into pr/686
* master: (62 commits)
  build_nested_query includes integer values
  Rack::ETag correctly marks etags as Weak
  Fix yet another body close bug in Rack::Deflater
  Implement full Logger interface on NullLogger
  Revert "support empty string multipart filename"
  support empty string multipart filename
  multipart/form-data with files with no input name
  Fix parent type API regression introduced in #713
  correct weird case regression from #714
  UrlMap: Enable case-insensitive domain matching
  Raise specific exception if the parameters are invalid
  Fix media_type_params when Content-Type parameters contains quoted-strings
  Rack::Multipart::UploadedFile has file extensions
  multipart content-type match now case insensitive
  Undo test that falsely exemplifies production env
  default_middleware_by_environment should always returns empty array for unknown keys
  Remove rbx from Travis' allow_failures
  Fix rbx settings for Travis
  Use latest 2.1 on Travis
  Enable cleanup of Tempfiles from multipart form data by default
  ...

Conflicts:
	lib/rack/request.rb
9f52bb1
@raggi raggi Merge branch 'pr/686'
* pr/686:
  add support for application/json content type requests
e4fd87f
@raggi raggi Merge pull request #674 from ujifgc/be-quiet
add quiet mode of rack server, rackup --quiet
84f2946
@raggi raggi Merge pull request #669 from alindeman/multiple_x_http_forwarded_proto
request.port supports multiple x-http-forwarded-proto values
885765d
@raggi raggi Apparently 1.9.2-p326 regressed, so fix that 5b23bd1
@raggi raggi And rvm has p328, magical versions! e98a9f7
Commits on Aug 05, 2014
@tenderlove tenderlove Revert "Merge branch 'pr/686'"
This reverts commit e4fd87f, reversing
changes made to d8e34e9.
92811ee
Commits on Aug 18, 2014
@spastorino spastorino Bump version e4e4c39
Commits on Aug 22, 2014
@olistik olistik Preserves extension in the created tempfile
This is handy when you have to pass the generated tempfile to gems that relies on the detection of filename extension ([simple-spreadsheet](https://github.com/zenkay/simple-spreadsheet), [roo](https://github.com/Empact/roo) to name my use case).
7e7cd1b
@raggi raggi Merge pull request #725 from olistik/features/tempfile-extension
Preserves extension in the created tempfile
366c124
Commits on Sep 01, 2014
@jeremy jeremy Restore Rack::Server#middleware backward compatibility
Fixes regression in #706. It intends to retain backward compatibility
with calls to #middleware by aliasing the method to the new
default_middleware_for_environment, but since it doesn't call #middleware
internally, subclasses that overrode it no longer work.

Restored compatibility by calling #middleware internally and delegating
its implementation to the new default_middleware_for_environment methods.
dc881c9
@spastorino spastorino Merge pull request #729 from jeremy/fixes/default-middleware-override…
…-regression

Restore Rack::Server#middleware backward compatibility
d79e9ee
Commits on Sep 03, 2014
@sodabrew sodabrew Trivial change to use single quotes for consistency 5500212
Commits on Sep 07, 2014
@jeremy jeremy Merge pull request #730 from sodabrew/patch-1
Trivial change to use single quotes for consistency
a71be3c
Commits on Oct 02, 2014
@schneems schneems Less allocated objects on each request
How many? Using `memory_profiler` and a Rails app (codetriage.com), master uses:

```
rack/lib x 7318
```

After this patch, the app uses:

```
rack/lib x 4598
```

Or `(7318 - 4598) / 7318.0 * 100 # => 37.16` % fewer objects __PER REQUEST__.

To do this, I extracted really commonly used strings into top level Rack constants. It makes for a bit of a big diff, but I believe the changes are worth it. 

Running benchmark/ips against the same app, I'm seeing a performance host of `2~4%` across the entire app response. This doesn't just make Rack faster, it will make your app faster.

While we could certainly go overboard and pre-define ALL strings as constants, that would be pretty gnarly to work with. This patch goes after the largest of the low hanging fruit.
dc53a8c
@rkh rkh Merge pull request #737 from schneems/schneems/less-objects
Less allocated objects on each request
ab172af
@schneems schneems Fix: `respond_to?` takes 2 arguments
The `respond_to?` method was optimized for less object creation, unfortunately I also mangled the method signature. This commit reverts the changes introduced in #737 to `BodyProxy#respond_to?` and adds tests.

See: https://github.com/rack/rack/pull/737/files#r18359323

cc/ @raggi
a9c0e35
@rkh rkh Merge pull request #739 from schneems/schneems/fix-respond_to
Fix: `respond_to?` takes 2 arguments
022b007
Commits on Oct 03, 2014
@soulim soulim Follow-up for the pull request #737
More commonly used strings converted into constants, and some strings are replaced with previously extracted constants.
131d9fd
Commits on Oct 05, 2014
Eric Wong conditionalget: avoid const lookup in case/when
case/when dispatches already optimize away allocation of constant
string literals in all C Ruby 1.9.x/2.x releases
(ref: opt_case_dispatch in Ruby insns.def)

Other Ruby implementations presumably have similar optimizations
to encourage prettier code.

The following code snippet does not cause GC.count to increase
during the two loops, regardless of what `nr' is.
Tested on Ruby 1.9.3, 2.1.3, and trunk r47786:

    GET = "GET"
    HEAD = "HEAD"
    REQUEST_METHOD = "REQUEST_METHOD" # unnecessary in 2.2.0+
    env = { REQUEST_METHOD => "GET" }

    nr = 10000000
    nr.times do |i|
      case env[REQUEST_METHOD]
      when GET, HEAD
        :foo
      else
        :bar
      end
    end
    a = GC.count

    nr.times do |i|
      case env[REQUEST_METHOD]
      when "GET", "HEAD"
        :foo
      else
        :bar
      end
    end
    b = GC.count
    p [ a, b ]
68e086d
Commits on Oct 06, 2014
@schneems schneems Missed optimizations
- freezing constant string to ensure it's not mutated
- use constant where available
- optimize `respond_to?` to take less memory. 

Discussed in #737 and #739

`respond_to?` takes two arguments all recent rubies:

- http://ruby-doc.org/core-2.1.3/Object.html#method-i-respond_to-3F
- http://ruby-doc.org/core-1.9.3/Object.html#method-i-respond_to-3F
- http://ruby-doc.org/core-1.8.7/Object.html#method-i-respond_to-3F

Also `method_missing` will return a symbol from the first argument:

- http://ruby-doc.org/core-2.1.3/BasicObject.html#method-i-method_missing
- http://ruby-doc.org/core-1.9.3/BasicObject.html#method-i-method_missing
- http://ruby-doc.org/core-1.8.7/Kernel.html#method-i-method_missing
5f808aa
Commits on Oct 10, 2014
@createdbypete createdbypete Fix typo in comment fd6daea
@rkh rkh Merge pull request #744 from createdbypete/fix-typo
Fix typo in comment
575bbcb
Commits on Nov 03, 2014
@vais vais Avoid WEBrick handler buffering the entire response in RAM a864564
Commits on Nov 04, 2014
@vais vais Ensure body is closed inside the proc just as it would be outside the…
… proc

Serving the body is wrapped in begin/ensure/end so that body.close is
always called if there are any problems. Now that looping over the body
happens in a proc, the proc has to have its own begin/ensure/end block
to guarantee the same behavior.
a0b8fe3
@vais vais Revert "Ensure body is closed inside the proc just as it would be out…
…side the proc"

This reverts commit a0b8fe3.
9a4c822
Commits on Nov 06, 2014
@vais vais Ensure body is closed inside the proc. Follow existing monkey patch s…
…tyle.

* Serving the rack body is wrapped in begin/ensure/end so that
body.close is guaranteed to be called per rack SPEC. When body
iteration happens inside a proc, the proc has to have its own
begin/ensure/end block to be able to make the same guarantee.
* Made my monkey patch for WEBrick::HTTPResponse follow same style as
the other monkey patch already present in the file and added a comment.
8fd92df
Commits on Nov 07, 2014
@tonyta tonyta update HTTP status codes to IETF RFC 7231 be28c6a
@spastorino spastorino Merge pull request #754 from tonyta/http-status-codes-update
Update HTTP Status Codes
9d43d2e
Commits on Nov 15, 2014
@vais vais Use to_path API per rack SPEC to serve files ae78184
@raggi raggi Merge pull request #753 from vais/master
Avoid WEBrick handler buffering the entire response in RAM
c8078ba
Commits on Nov 21, 2014
@igas igas Remove unused dependency from Deflater 75b608d
@spastorino spastorino Merge pull request #760 from igas/remove-require-from-deflater
Remove unused dependency from Deflater
b2e4e4b
Commits on Nov 26, 2014
@byroot byroot Explicitly fail when hitting the multipart limit
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
b0b5fb9
@spastorino spastorino RACK_MULTIPART_LIMIT is a better name f08b5a1
@spastorino spastorino MultipartLimitError => MultipartPartLimitError 99a1a62
Commits on Nov 27, 2014
@codekitchen codekitchen allow overriding the rack multipart parser tempfile class
This allows for more flexibility in how to buffer (or stream) multipart
file uploads, rather than always using Tempfile and buffering to local
TMPDIR.
a7cb430
@codekitchen codekitchen add rack.multipart options to lint and SPEC a604924
@spastorino spastorino Merge branch 'codekitchen-streaming-multipart'
Closes #639
9bbca97
@spastorino spastorino Fix #639 wrong merge be3e305
@graysonwright graysonwright Extract several methods from Rack::File#serving
Extracted methods:

  - mime_type
  - filesize
  - response_body

Closes #570

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
398c59f
@spastorino spastorino Merge pull request #399 from EqualMedia/rfc2616-compat
Validate header names according to RFC 2616
34b981e
@spastorino spastorino Bump to 1.6.0.beta2 8cb9b65
@raggi raggi Rack::Lint and SPEC align with RFC7230 headers 6839fc2
@raggi raggi Header specification change increments SPEC 28e77c7
@byroot byroot Document the multipart_part_limit configuration in the README f86c885
@raggi raggi Merge pull request #763 from byroot/multipart-limit-doc
Document the multipart_part_limit configuration in the README
1e162b9
Commits on Nov 30, 2014
@amarshall amarshall Use a monotonic time for Rack::Runtime, if available
Time.now is prone to inaccuracies if the system time changes during the
request. This could be due to DST, NTP, etc. Using a monotonic clock
(available in Ruby 2.1+ on certain platforms) avoids this problem.
2474e3a
Commits on Dec 18, 2014
@tenderlove tenderlove bumping version 987c818
@tenderlove tenderlove use shasum 65a7104
Commits on Dec 23, 2014
@spastorino spastorino RACK_MULTIPART_LIMIT should've been RACK_MULTIPART_PART_LIMIT c096c50
@spastorino spastorino Fix RACK_MULTIPART_LIMIT removal wording 8d21788
@raggi raggi Merge pull request #762 from amarshall/monotonic-runtime
Use a monotonic time for Rack::Runtime, if available
c9199a8
@raggi raggi Fix lint header regex 16feaaf
Commits on Dec 28, 2014
@JonMidhir JonMidhir Remove markdown from RDoc readme 81b9f1f
@JonMidhir JonMidhir Remove Markdown backticks for inline code in Readme 57f7b9c
Commits on Dec 29, 2014
@raggi raggi Merge pull request #772 from JonMidhir/readme_fix
Remove Markdown from RDoc Readme
b227ffc
Commits on Jan 03, 2015
@dblock dblock Moved HISTORY into a separate document. 7833d05
@dblock dblock Fix #773: Rack.release must match value in gemspec. cae9f5c
Commits on Jan 04, 2015
@tenderlove tenderlove Merge pull request #777 from dblock/fix-release-version
Fix #773: Rack.release must match value in gemspec.
dfda3a5
Commits on Jan 06, 2015
@p8952 p8952 Update to reflect changes in #514 076711a
@raggi raggi Merge pull request #780 from p8952/fix-host-help
Update to reflect changes in #514
0c681ae
@raggi raggi Update travis.yml since we added bundler and stuff 7abd834
@raggi raggi did you know you could use turtles to shave yaks? 11d94eb
@raggi raggi Oh look, no one has run fulltest for so long ecae317
@raggi raggi Run all the tests on ci, we have the pkgs 6c89d9d
@raggi raggi Fix spec versions in all handler files ed90508
Commits on Jan 07, 2015
@Nyoho Nyoho Fix semicolons as separators for GET
Fix to use semicolons as separators for GET not for POST
A semicolon ';' should be used as a separator according to a W3.org recommendation
http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2

The following commit was for only POST not for GET, but the test is
written for GET, which is kind of a discrepancy.
Do not truncate POST data on `;`, closes #543
71c6911
6af5f92
Commits on Jan 23, 2015
@arcz arcz Update head.rb
Fix indentation and move comment
471a0d8
Commits on Jan 28, 2015
@tagliala tagliala Add woff2 mime type 1cb417b
Commits on Feb 02, 2015
@spastorino spastorino Merge pull request #742 from schneems/schneems/freeze-string
Missed optimizations
558cf20
@spastorino spastorino Merge pull request #788 from arcz/patch-1
Update head.rb Fix indentation and move comment
027ae98
@spastorino spastorino Remove whitespaces 15bbd0c
@spastorino spastorino Merge pull request #791 from tagliala/add-woff2-mime-type
Add woff2 mime type
7c574e2
Commits on Feb 04, 2015
@yeonhoyoon yeonhoyoon fix typo 2ffefc6
Commits on Feb 05, 2015
@jakimowicz jakimowicz add office related Mime type 1aef641
Commits on Feb 09, 2015
@spastorino spastorino Merge pull request #793 from yeonhoyoon/master
fix typo
2c35243
Commits on Feb 11, 2015
@eileencodes eileencodes Reduce object allocations in Rack::Utils
Using AllocationTracer we were able to find unnecessary allocations of
objects.

1) `[]=` is duping the hash key object on assignment. Frezing
`k.downcase` will prevent this.

2) `parse_nested_query` was taking unnecessary steps when the string was
empty. We can just return a `{}` instead if `qs` is empty.

AllocationTracer object allocation before these changes:
```
[["/rack/lib/rack/utils.rb", 500, :T_STRING], [56981, 4303, 78980, 0, 13, 2032240]]
[["/rack/lib/rack/utils.rb", 498, :T_STRING], [51000, 0, 45775, 0, 2, 1904680]]
[["/rack/lib/rack/utils.rb", 114, :T_STRING], [39123, 0, 35116, 0, 1, 4711600]]
[["/rack/lib/rack/utils.rb", 661, :T_STRING], [32993, 0, 29621, 0, 1, 1232289]]
[["/rack/lib/rack/body_proxy.rb", 34, :T_ARRAY], [30000, 0, 26930, 0, 1, 1120400]]
```
AllocationTracer object allocation after these changes:
```
[["/rack/lib/rack/utils.rb", 499, :T_STRING], [46665, 969, 54210, 0, 13, 1702720]]
[["/rack/lib/rack/utils.rb", 662, :T_STRING], [31375, 0, 30647, 0, 2, 1175369]]
[["/rack/lib/rack/body_proxy.rb", 34, :T_ARRAY], [28550, 0, 27880, 0, 2, 1068800]]
[["/rails/activesupport/lib/active_support/subscriber.rb", 99, :T_STRING], [28534, 0, 27869, 0, 2, 1068560]]
[["/rails/activesupport/lib/active_support/notifications/fanout.rb", 55, :T_DATA], [28528, 0, 27864, 0, 2, 3098592]]
```
c4596b3
@tenderlove tenderlove Merge pull request #795 from eileencodes/reduce-object-allocations
Reduce object allocations in Rack::Utils
ec98130
Commits on Feb 12, 2015
@tgxworld tgxworld Use default bundle install command. 5ed17cc
@spastorino spastorino Merge pull request #796 from tgxworld/default_bundle_install
Use default bundle install command.
f4fa3af
Commits on Feb 15, 2015
@smcgivern smcgivern Prioritise CLI options over comment options
There are four sources of options for `Rack::Server`:

1. In the constructor, as a hash: `Rack::Server.new(server: 'thin')`
2. On the command line: `bundle exec rackup --server thin`
3. In a magic comment on the first line of config.ru (or whichever
   config file was used): `#\ --server thin`
4. `Rack::Server#default_options`

If 1 is provided, 4 and 2 won't be used. Previously, the order of
precedence - earlier 'wins' - was either:

* 1, 3
* 3, 2, 4

This changes the latter to 2, 3, 4. This allows an app to specify a
default port in the magic comment, but for that to be changed when using
the `rackup` script.
d924f80
Commits on Feb 17, 2015
@fay-jai fay-jai Update license with up-to-date year 116b9c6
@eileencodes eileencodes Fix bug when `qs` is `nil`
In c4596b3 I failed to test Rails tests and in working on other issues
discovered some Rails ActionPack tests weren't erroring. I found that
sometimes `qs` is nil so I changed this to check for `qs.nil? || qs.empty?`.
0f0bf32
Commits on Feb 18, 2015
@tgxworld tgxworld Reduce object allocation.
Before:
```
[[".rbenv/versions/2.2.0/lib/ruby/2.2.0/uri/common.rb", 383, :T_STRING], [113158, 342, 114877, 0, 28, 5989110]]
[["rack/lib/rack/utils.rb", 87, :T_STRING], [110615, 57, 108492, 0, 28, 12576892]]
[["rails-dev-box/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb", 243, :T_STRING], [59564, 0, 58024, 0, 1, 2304160]]
[["rack/lib/rack/utils.rb", 89, :T_ARRAY], [56601, 0, 55128, 0, 2, 2189560]]
[["rails-dev-box/rails/actionpack/lib/action_controller/metal/strong_parameters.rb", 541, :T_STRING], [54652, 0, 53229, 0, 2, 5830250]]
[["rails-dev-box/rails/activesupport/lib/active_support/subscriber.rb", 99, :T_STRING], [53606, 0, 52222, 0, 1, 2073520]]
[["rails-dev-box/rails/activesupport/lib/active_support/notifications/instrumenter.rb", 52, :T_HASH], [50621, 16, 49447, 0, 22, 8126520]]
[["rack/lib/rack/utils.rb", 89, :T_STRING], [41706, 0, 40620, 0, 2, 1613360]]
[["rails-dev-box/rails/activesupport/lib/active_support/notifications/fanout.rb", 55, :T_DATA], [41694, 0, 40618, 0, 1, 4676888]]
[["rails-dev-box/rails/activerecord/lib/active_record/relation/query_methods.rb", 56, :T_ARRAY], [41690, 0, 40612, 0, 1, 1612560]]
```
After:
```
[[".rbenv/versions/2.2.0/lib/ruby/2.2.0/uri/common.rb", 383, :T_STRING], [113994, 348, 116830, 0, 28, 6032912]]
[["rack/lib/rack/utils.rb", 87, :T_STRING], [111363, 58, 110247, 0, 28, 12668100]]
[["rails-dev-box/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb", 243, :T_STRING], [59996, 0, 58968, 0, 1, 2321120]]
[["rails-dev-box/rails/actionpack/lib/action_controller/metal/strong_parameters.rb", 541, :T_STRING], [54964, 0, 54050, 0, 1, 5870020]]
[["rails-dev-box/rails/activesupport/lib/active_support/subscriber.rb", 99, :T_STRING], [53990, 0, 53070, 0, 1, 2088880]]
[["rails-dev-box/rails/activesupport/lib/active_support/notifications/instrumenter.rb", 52, :T_HASH], [50989, 11, 50231, 0, 25, 8188064]]
[["rails-dev-box/rails/activerecord/lib/active_record/relation/query_methods.rb", 56, :T_ARRAY], [42006, 0, 41282, 0, 1, 1624960]]
[["rack/lib/rack/utils.rb", 89, :T_ARRAY], [42002, 0, 41278, 0, 2, 1624880]]
[["rack/lib/rack/utils.rb", 89, :T_STRING], [42002, 0, 41279, 0, 2, 1624880]]
[["rails-dev-box/rails/activesupport/lib/active_support/notifications/fanout.rb", 55, :T_DATA], [42000, 0, 41286, 0, 1, 4712384]]
```
2029ee8
@chneukirchen chneukirchen Merge pull request #799 from fay-jai/license
Update license with up-to-date year
a5066d1
@eileencodes eileencodes Freeze 'X-Runtime' string
Move 'X-Runtime' to a constant and freeze. Combine with other
`FORMAT_STRING` constant used in the class.

We are freezing these strings to reduce the number of allocations in
Rails integration tests. The tests are spending a lot of time in GC and
this reduces the amount of time spent from 12% to 9% (in combination
with Rails PR that also freezes some strings).

Strings allocated before this change: 1030722
Strings allocated after this change: 1024722
59061c0
@eileencodes eileencodes Don't pass arguments to `#each`
Nothing is actually passed to `#each` so we shouldn't be passing `*args`.
This change eliminates proc and array allocations here.

Before this change `#each` on rack/lib/rack/body_proxy.rb:34 was number
3 in highest allocations for Rails integration tests. After this change it's
no longer in the top 5.
c6095e8
@eileencodes eileencodes Clean up `@names` hash
Tidies up the `@names` hash so we don't need to store as much in it.
82c5e87
Commits on Feb 19, 2015
@tgxworld tgxworld Reduce string allocations.
Before total allocations = 69010
```
[[rack/lib/rack/utils.rb", 314, :T_STRING], [39000, 22, 38009, 0, 27, 2536600]]
[[rack/lib/rack/utils.rb", 312, :T_STRING], [12004, 0, 11518, 0, 2, 464800]]
[[rack/lib/rack/utils.rb", 313, :T_STRING], [18006, 0, 17274, 0, 1, 2803325]]
```

After total allocations = 45000
```
[[rack/lib/rack/utils.rb", 315, :T_STRING], [45000, 41, 45338, 0, 28, 4160731]]
```
c1510b0
@tomstuart tomstuart Update documentation of Rack::Response defaults
The “containing HTML” remark stopped being true in 3623d04, as reflected by https://github.com/rack/rack/blob/master/test/spec_response.rb#L5-L21.
571d1e8
@rkh rkh Merge pull request #806 from tomstuart/patch-1
Update documentation of Rack::Response defaults
7b238fc
@tenderlove tenderlove Merge pull request #805 from tgxworld/reduce_string_allocations
Reduce string allocations.
331a32e
@tenderlove tenderlove Merge pull request #801 from tgxworld/reduce_object_allocation
Reduce object allocation.
97795d4
@tenderlove tenderlove Merge pull request #804 from eileencodes/clean-up-names-hash
Clean up `@names` hash
5ef7ee8
@tenderlove tenderlove Merge pull request #803 from eileencodes/dont-pass-arguments-to-each
Don't pass arguments to `#each`
80d7b72
@tenderlove tenderlove Merge pull request #802 from eileencodes/freeze-x-runtime-strings-to-…
…reduce-allocations

Freeze 'X-Runtime' string
813cd6c
@tenderlove tenderlove Merge pull request #800 from eileencodes/fix-bug-in-rails-when-qs-is-nil
Fix bug when `qs` is `nil`
aec5471
@tenderlove tenderlove Merge pull request #794 from jakimowicz/add_office_extensions
add office related Mime type
163b673
@tenderlove tenderlove Merge pull request #776 from dblock/history
Moved HISTORY into a separate document.
d4c6cfc
@tenderlove tenderlove Merge branch 'master' into soulim-even-less-objects
* master: (53 commits)
  Update documentation of Rack::Response defaults
  Reduce string allocations.
  Clean up `@names` hash
  Don't pass arguments to `#each`
  Freeze 'X-Runtime' string
  Reduce object allocation.
  Fix bug when `qs` is `nil`
  Update license with up-to-date year
  Use default bundle install command.
  Reduce object allocations in Rack::Utils
  add office related Mime type
  fix typo
  Remove whitespaces
  Add woff2 mime type
  Update head.rb
  Fix spec versions in all handler files
  Run all the tests on ci, we have the pkgs
  Oh look, no one has run fulltest for so long
  did you know you could use turtles to shave yaks?
  Update travis.yml since we added bundler and stuff
  ...

Conflicts:
	lib/rack/file.rb
6f8808d
@davydovanton davydovanton Added links to profile page for all rack team members 877d7a8
Commits on Feb 25, 2015
@tgxworld tgxworld Reduce String allocations.
Before:
```
[["rack/lib/rack/utils.rb", 89, :T_STRING], [41986, 0, 40154, 0, 2, 1627920]]
[["rack/lib/rack/utils.rb", 116, :T_STRING], [17982, 0, 17490, 0, 2, 695760]]
```

After:
```
[["rack/lib/rack/utils.rb", 89, :T_STRING], [27000, 0, 25875, 0, 1, 1046880]]
[["rack/lib/rack/utils.rb", 116, :T_STRING], [12000, 0, 11283, 0, 2, 465120]]
```
19e8e49
@tgxworld tgxworld Reduce Array allocations.
Before
```
[["rack/lib/rack/utils.rb", 116, :T_ARRAY], [11988, 0, 11663, 0, 2, 463840]]
```

After
```
[["rack/lib/rack/utils.rb", 116, :T_ARRAY], [6002, 0, 5624, 0, 2, 232640]]
```
6dfe4a7
@tgxworld tgxworld Reduce String allocations by storing common seperators in a constant.
Before:
```
[["rack/lib/rack/utils.rb", 87, :T_STRING], [111173, 57, 106670, 0, 27, 12654156]]
[["rack/lib/rack/utils.rb", 115, :T_STRING], [30244, 58, 29580, 0, 27, 3275248]]
```

After:
```
[["rack/lib/rack/utils.rb", 88, :T_STRING], [20979, 136, 21178, 0, 27, 1677320]]
[["rack/lib/rack/utils.rb", 116, :T_STRING], [8995, 137, 9943, 0, 27, 581392]]
```
68c7b16
@tgxworld tgxworld Prefer String concatenation.
Before:
```
[["rack/lib/rack/utils.rb", 280, :T_STRING], [12004, 0, 11304, 0, 1, 463840]]
```

After:
```
[["rack/lib/rack/utils.rb", 280, :T_STRING], [5996, 0, 5706, 0, 2, 232320]]
```
55cd3ee
Commits on Feb 27, 2015
@DamirSvrtan DamirSvrtan Use yield instead of block.call 96f759c
Commits on Mar 01, 2015
@eileencodes eileencodes Remove check for `nil` on `qs`
Fixed by brynary/rack-test@4a4b2c1. rack-test was turning the query
string to nil if there was no argument passed in the params. This extra
`nil` check is no longer necessary after the changes made to the
rack-test gem. Fixes issue brought up in #800.
7b45bbd
Eric Wong README: remove Rainbows! and Zbatery from server list
While they remain supported as far as bug/compatibility fixes go,
they're too much work to configure and probably too confusing for
new users unfamiliar with Rack.

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
e117591
@DamirSvrtan DamirSvrtan Remove &block argument from assert 84f98cf
@spastorino spastorino Merge pull request #813 from eileencodes/remove-check-for-nil
Remove check for `nil` on `qs`
7788a1b
@spastorino spastorino Merge pull request #809 from tgxworld/reduce_allocations
Reduce allocations
1a43de5
Commits on Mar 03, 2015
@johnnaegle johnnaegle test is an exact duplicate.
Flay output:

3) IDENTICAL code found in :iter (mass*2 = 152)
  spec_multipart.rb:256
  spec_multipart.rb:264
1081c12
Commits on Mar 04, 2015
@english english Handle mulipart/... requests with no part names
Previously, Rack would assume there would be either a Content-Disposition or Content-ID
header for multipart request parts. This is not required in [rfc1341][0].

Now, Rack will use the Content-Type (falling back to text/plain) for the part name,
storing parameters in an array, keyed off the content type.

[0]: http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
bc3aa3e
Commits on Mar 05, 2015
@jeremy jeremy Revert "Merge pull request #813 from eileencodes/remove-check-for-nil"
Add a test demonstrating that `nil` is treated as an empty query string

This reverts commit 7788a1b, reversing
changes made to e117591.
0575eb9
@tenderlove tenderlove Merge pull request #816 from english/fix-multipart-noname
Handle mulipart requests with no part names
b510afd
@tenderlove tenderlove Merge pull request #815 from johnnaegle/remove_duplicate_test
Remove a duplicate test
56249a7
@tenderlove tenderlove Merge pull request #810 from DamirSvrtan/yield_instead_of_block_call
Use yield instead of block.call
c7d7fe6
@tenderlove tenderlove Merge pull request #807 from davydovanton/update-readme
Added links to profile page for all rack core team and alumnis members
3307a8a
@tenderlove tenderlove Merge pull request #798 from smcgivern/option_order
Prioritise CLI options over comment options
4e4ab39
Commits on Mar 06, 2015
@eileencodes eileencodes Expand initialize ivars instead of using 1 line
Flattening the ivars here causes them to be allocated as an array.
This commit expands them to avoid these extra allocations.

Total allocations before: 2913000
Total allocations after:  2892000
ce6303c
Commits on Mar 09, 2015
@spastorino spastorino Merge pull request #819 from eileencodes/expand-initalize-ivars
Expand initialize ivars instead of using 1 line
41f319c
@johnnaegle johnnaegle Only increment the opened_files counter for file inputs. If you have a
large form with only one file, you can quickly hit the MultipartPartLimitError
Add test for not hitting the multipart limit
7331561
Commits on Mar 11, 2015
@spastorino spastorino Merge pull request #814 from johnnaegle/only_increment_open_file_coun…
…t_for_fileparts

Only count files (not all form elements) against the Multipart File Limit
7a3405f
Commits on Mar 15, 2015
Maksim Sitnikov Fix history link 9303790
@spastorino spastorino Merge pull request #824 from sitnikovme/master
Fix history link
d1d380c
Commits on Mar 25, 2015
@snuggs snuggs Place comma before and e51b1af
@chneukirchen chneukirchen Merge pull request #827 from snuggs/fix-gramatical-error
Place comma before and
4d03a0c
Commits on Apr 06, 2015
@spastorino spastorino Merge pull request #781 from Nyoho/fix-separator-semicolon-GET
Fix semicolons as separators for GET
6d978cb
@spastorino spastorino Give parse_query's second argument a default value d68b93a
Commits on Apr 14, 2015
@davydovanton davydovanton Fix typos in test files [skip ci] 15fa097
Commits on Apr 16, 2015
@spastorino spastorino Merge pull request #840 from davydovanton/fix-test-typos
Fix typos in test files
e76875a
@spastorino spastorino Bump Travis 2.2 MRI to 2.2.2 59f7a42