Skip to content
This repository
Browse code

Rewind body necessary due to changes in Rack

  • Loading branch information...
commit 0b473f62acd5a678743de6333bdc9fed1366d0c8 1 parent ca6d0cc
Peter Wagenet authored September 13, 2010

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. 2  lib/sproutcore/rack/proxy.rb
2  lib/sproutcore/rack/proxy.rb
@@ -80,6 +80,8 @@ def handle_proxy(proxy, proxy_url, env)
80 80
               response = http.send(http_method, http_path, headers)
81 81
             else
82 82
               http_body = env['rack.input']
  83
+              http_body.rewind
  84
+
83 85
               some_request = Net::HTTPGenericRequest.new http_method.upcase,
84 86
                               true, true, http_path, headers
85 87
 

2 notes on commit 0b473f6

Tyler Keating

Great! But correct me if I'm wrong, isn't there still a problem with "204 No Content" responses, because Thin can't accept response.body == nil. I had to change line 242 to:

return [status, ::Rack::Utils::HeaderHash.new(response_headers), [response.body ? response.body : '']]
Please sign in to comment.
Something went wrong with that request. Please try again.