Date | Commit message (Collapse) |
|
http://docs.travis-ci.com/user/languages/ruby/#Default-Test-Script.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
Document the multipart_part_limit configuration in the README
|
|
|
|
|
|
|
|
|
|
Validate header names according to RFC 2616
|
|
Extracted methods:
- mime_type
- filesize
- response_body
Closes #570
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|
|
|
Closes #639
|
|
|
|
This allows for more flexibility in how to buffer (or stream) multipart
file uploads, rather than always using Tempfile and buffering to local
TMPDIR.
|
|
|
|
|
|
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|
Remove unused dependency from Deflater
|
|
|
|
Avoid WEBrick handler buffering the entire response in RAM
|
|
|
|
Update HTTP Status Codes
|
|
IANA Source: https://www.iana.org/assignments/http-status-codes
IETF RFC 7231: https://tools.ietf.org/html/rfc7231
|
|
* 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.
|
|
the proc"
This reverts commit a0b8fe36d456b2dd339d65836a753ff4260dd8f6.
|
|
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.
|
|
|
|
Fix typo in comment
|
|
|
|
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 ]
|
|
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
|
|
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.
|
|
Trivial change to use single quotes for consistency
|
|
|
|
Restore Rack::Server#middleware backward compatibility
|