Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proxy_request = ->(env : HTTP::Server::Context) do
- req = env.request
- req.path = "some_prefix" + req.path
- req.headers.delete("Accept-Encoding")
- req.headers.delete("X-Auth-Token")
- response = HTTP::Client.new(
- "new_host", 443, true
- ).exec req
- env.response.headers.merge!(response.headers)
- env.response.status_code = response.status_code
- env.response.print response.body
- env.response.flush
- ""
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement