Brother proxy: rewind request body before forwarding (Rack 3 leaves it consumed)
deploy / deploy (push) Successful in 12s

This commit is contained in:
randy committed 2026-10-30 13:56:55 +01:00
1 parent fc59cf595e
commit 7dabfb6223
1 file changed
+6 -1
+6 -1
View File
@@ -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) }