Date | Commit message (Collapse) |
|
Using the Queue class in stdlib is sufficient for this test,
so there's no need for a new development dependency.
And one big reason I like webrick is it's bundled with
Ruby and has no 3rd-party C ext dependencies; so having
to download and install one is a bummer.
|
|
This behavior is there for use cases like the Rack::Reloader. If you
need to cache the app it is better to call `to_app` when needed or use
`Rack::Builder.app`.
Closes #834
|
|
This reverts commit 2afc14627c9656004325ae17d028ebe7f7e73c0f, reversing
changes made to 51356a65185d6c74f7e588ec468ad64ca3a49bcb.
|
|
Avoid re-calculation in Rack::Builder call method
|
|
Add frozen_string_literal to utils
|
|
Valid Rack::Deflater :if config example
|
|
|
|
Speeds up methods by not requiring string literals to be allocated on every call.
|
|
Prefer Event over CountDownLatch
|
|
It's slightly nicer to read, and incidentally avoids a missing require.
|
|
Fix typos
|
|
|
|
|
|
Add multi mapping support via header
|
|
Fix the code block used to generate the HTTP_STATUS_CODES hash
|
|
|
|
Reduce memory usage when uploading large file
|
|
|
|
|
|
The patch can be found at
https://groups.google.com/d/msg/rack-devel/Imtb_19E0WM/DQG74tbOBQAJ.
|
|
Patch can be found in https://groups.google.com/d/msg/rack-devel/QmLRFtKeywQ/EJRXNnrPBQAJ
|
|
Add Hanami to the list of frameworks that use Rack.
|
|
|
|
|
|
Boost multipart parsing perf by increasing buffer size from 16 KiB to 1 MiB
|
|
This increases the buffer size to 1mb to get better performance
parsing larger files. Buffer sizes of 16kb, 1mb, 10mb, and 100mb
were compared based on performance and cpu/memory usage.
|
|
Large file upload performance fix
|
|
|
|
Update homepage links to be HTTPS
|
|
Stop replacing the environment in Rack::Lock
|
|
|
|
While the flow of environment information is generally downstream only,
test frameworks sometimes rely on being able to pull information added
to the environment after `.call`.
|
|
|
|
As with commit 2474e3a779a8d2b6 for Rack::Runtime,
Time.now is inaccurate if system time changes, so do not
rely on it if a monotonic clock is available.
|
|
Only create a Time object if the Last-Modified header exists,
(immediately use the Integer result of Time#to_). Otherwise, we
can rely on the default behavior of Zlib::GzipWriter of setting
the mtime to the current time.
While we're at it, avoid repeating the hash lookup for
Last-Modified.
This results in an improvement from 11.0k to 11.4k iterations/sec
with the following script:
require 'benchmark/ips'
require 'rack/mock'
req = Rack::MockRequest.env_for('', 'HTTP_ACCEPT_ENCODING' => 'gzip')
response = [200, {}, []]
deflater = Rack::Deflater.new(lambda { |env| response })
Benchmark.ips do |x|
x.report('deflater') do
s, h, b = deflater.call(req)
b.each { |buf| }
b.close
end
end
|
|
The next commit will reduce long-lived Time objects. Regardless
of whether that commit is acceptable, having extra tests for
existing mtime behavior cannot hurt.
For testing responses with the Last-Modified header, setting a
random date in the past should make failure to preserve mtime
in the gzip header more apparent.
|
|
Flushing after after very flush is great for real-time apps.
However, flushing is inefficient when apps use Rack::Response
to generate many small writes (e.g. Rack::Lobster).
Allow users to disable the default "sync: true" behavior to
reduce bandwidth usage, otherwise using Rack::Deflater can lead
to using more bandwidth than without it.
|
|
We can merely set the @body to nil ensure we do not call close
on the @body, twice. Saving an ivar slot can save 8 bytes
per object at minimum, and this makes me feel more comfortable
about using another ivar for the next commit.
|
|
This improves readability of our code and can allow us to
generate less garbage in Ruby 2.3+ for places where we didn't
already use constants. We can also avoid the old constant
lookups (and associated inline cache overhead) this way.
|
|
Thanks pmc@citylink.dinoex.sub.org for the patch
|
|
|
|
|
|
Rely on input responding to #size instead of #length in MockRequest.env_for
|
|
Safely handle modules in `Rack::Session::Abstract::ID` subclass ancestor list
|
|
Adds a check before calling `superclass` on an ancestor of a subclass of `Rack::ID` to avoid calling `superclass` on `Module`, which does not implement it.
Here is an code example that causes exercises this special case:
```ruby
ID = Class.new
IDChild = Class.new(ID)
MyMod = Module.new
Foo = Class.new(IDChild)
Foo.include(MyMod)
Foo.ancestors.find { |kl| kl.superclass == ID }
# NoMethodError: undefined method `superclass' for MyMod:Module
Foo.ancestors.find { |kl| kl.respond_to?(:superclass) && kl.superclass == ID }
# => IDChild
```
|
|
When web servers read data from the socket it's encoded as ASCII_8BIT
because we don't know the encoding. This change makes the env closer to
what a real web server will return in production.
|
|
File.join supports an array parameter so we don't need to expand the
array to be mulitple parameters for File.join.
|
|
This reverts commit 7ca86b7c42def1865f032c4d71c01ea94584b470.
|
|
The #size method isn't part of the Rack input specification, so
technically the given Rack input object doesn't have to respond to
\#size.
This allows us to test our Rack applications with Rack input that
doesn't respond to #size, verifying that we're not relying on it.
|
|
StringIO is the only IO object that responds to #length, the Ruby IO
interface actually uses #size. Furthermore #size is actually implemented
on IO-like inputs on web servers like Unicorn and Passenger (TeeInput).
This change allows using (Temp)file objects as the Rack input.
|