diff --git a/app.rb b/app.rb index 7db6ade..fc9f37b 100644 --- a/app.rb +++ b/app.rb @@ -241,7 +241,12 @@ helpers do proxied['Content-Type'] = request.content_type if request.content_type proxied['X-Forwarded-Prefix'] = prefix proxied['X-Forwarded-Host'] = request.host - proxied.body = request.body.read unless request.request_method == 'GET' + # Sinatra already consumed the body when parsing params (Rack 3 no longer + # rewinds it), so rewind first or form POSTs reach brother_ql_web empty. + unless request.request_method == 'GET' + request.body.rewind + proxied.body = request.body.read + end res = Net::HTTP.start(uri.host, uri.port) { |http| http.request(proxied) }