Permalink
Commits on Nov 27, 2014
  1. Bump to 1.6.0.beta2

    spastorino committed Nov 27, 2014
  2. Merge pull request #399 from EqualMedia/rfc2616-compat

    spastorino committed Nov 27, 2014
    Validate header names according to RFC 2616
  3. Extract several methods from Rack::File#serving

    graysonwright authored and spastorino committed Nov 27, 2014
    Extracted methods:
    
      - mime_type
      - filesize
      - response_body
    
    Closes #570
    
    Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  4. Fix #639 wrong merge

    spastorino committed Nov 27, 2014
  5. allow overriding the rack multipart parser tempfile class

    codekitchen authored and spastorino committed Jan 6, 2014
    This allows for more flexibility in how to buffer (or stream) multipart
    file uploads, rather than always using Tempfile and buffering to local
    TMPDIR.
Commits on Nov 26, 2014
  1. Explicitly fail when hitting the multipart limit

    byroot authored and spastorino committed Aug 6, 2014
    Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Commits on Nov 21, 2014
  1. Merge pull request #760 from igas/remove-require-from-deflater

    spastorino committed Nov 21, 2014
    Remove unused dependency from Deflater
Commits on Nov 15, 2014
  1. Merge pull request #753 from vais/master

    raggi committed Nov 15, 2014
    Avoid WEBrick handler buffering the entire response in RAM
Commits on Nov 7, 2014
  1. Merge pull request #754 from tonyta/http-status-codes-update

    spastorino committed Nov 7, 2014
    Update HTTP Status Codes
Commits on Nov 6, 2014
  1. Ensure body is closed inside the proc. Follow existing monkey patch s…

    vais committed Nov 6, 2014
    …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.
Commits on Nov 4, 2014
  1. Revert "Ensure body is closed inside the proc just as it would be out…

    vais committed Nov 4, 2014
    …side the proc"
    
    This reverts commit a0b8fe3.
  2. Ensure body is closed inside the proc just as it would be outside the…

    vais committed Nov 4, 2014
    … 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.
Commits on Nov 3, 2014
Commits on Oct 10, 2014
  1. Merge pull request #744 from createdbypete/fix-typo

    rkh committed Oct 10, 2014
    Fix typo in comment
  2. Fix typo in comment

    createdbypete committed Oct 10, 2014
Commits on Oct 6, 2014
  1. Missed optimizations

    schneems committed Oct 3, 2014
    - 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
Commits on Oct 5, 2014
  1. conditionalget: avoid const lookup in case/when

    Eric Wong
    Eric Wong committed Oct 5, 2014
    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 ]
Commits on Oct 2, 2014
  1. Merge pull request #739 from schneems/schneems/fix-respond_to

    rkh committed Oct 2, 2014
    Fix: `respond_to?` takes 2 arguments
  2. Fix: `respond_to?` takes 2 arguments

    schneems committed Oct 2, 2014
    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
  3. Merge pull request #737 from schneems/schneems/less-objects

    rkh committed Oct 2, 2014
    Less allocated objects on each request
  4. Less allocated objects on each request

    schneems committed Oct 1, 2014
    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.
Commits on Sep 7, 2014
  1. Merge pull request #730 from sodabrew/patch-1

    jeremy committed Sep 7, 2014
    Trivial change to use single quotes for consistency
Commits on Sep 3, 2014
Commits on Sep 1, 2014
  1. Merge pull request #729 from jeremy/fixes/default-middleware-override…

    spastorino committed Sep 1, 2014
    …-regression
    
    Restore Rack::Server#middleware backward compatibility
  2. Restore Rack::Server#middleware backward compatibility

    jeremy committed Sep 1, 2014
    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.
Commits on Aug 22, 2014
  1. Merge pull request #725 from olistik/features/tempfile-extension

    raggi committed Aug 22, 2014
    Preserves extension in the created tempfile