Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix parsing back headers in RackCompatible middleware

  • Loading branch information...
commit 40ce5546f3083b832738dc4b98ab79fb4b62609e 1 parent 6cf599c
@mislav authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  lib/faraday_stack/rack_compatible.rb
  2. +2 −2 test/caching_test.rb
View
2  lib/faraday_stack/rack_compatible.rb
@@ -52,7 +52,7 @@ def restore_env(env)
env.each do |name, value|
next unless String === name
if NonPrefixedHeaders.include? name or name.index('HTTP_') == 0
- name = name.sub(/^HTTP_/).downcase.tr('_', '-')
+ name = name.sub(/^HTTP_/, '').downcase.tr('_', '-')
headers[name] = value
end
end
View
4 test/caching_test.rb
@@ -104,8 +104,8 @@ def setup
def_delegators :@conn, :get, :post
def test_cache_get
- assert_equal 'request:1', get('/').body
- response = get('/')
+ assert_equal 'request:1', get('/', :user_agent => 'test').body
+ response = get('/', :user_agent => 'test')
assert_equal 'request:1', response.body
assert_equal 'text/plain', response['content-type']
Please sign in to comment.
Something went wrong with that request. Please try again.