mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
![]() If requests go through a proxy, they will have the original uri in the request, i.e. : GET http://proxy.server.uri/some/query/string HTTP 1.1 ... That was problematic -- cowboy_http_protocol:request didn't know what to to with the result of decode_packet applied to this, which would be something like: ``` erlang {http_request,'GET',{absoluteURI,http,<<"proxy.server.uri">>, undefined,<<"/some/query/string">>},{1,1}} ``` So, I just ignore the host, grab the path and pass into ``` erlang cowboy_http_protocol:request({http_request, Method, {abs_path, Path}, Version}, State) ``` Seems to do the trick without much effort. |
||
---|---|---|
.. | ||
autobahn_SUITE_data | ||
http_SUITE_data | ||
autobahn_SUITE.erl | ||
chunked_handler.erl | ||
dispatcher_prop.erl | ||
http_handler.erl | ||
http_handler_errors.erl | ||
http_handler_init_shutdown.erl | ||
http_handler_long_polling.erl | ||
http_handler_multipart.erl | ||
http_handler_set_resp.erl | ||
http_handler_stream_body.erl | ||
http_SUITE.erl | ||
proper_SUITE.erl | ||
rest_forbidden_resource.erl | ||
rest_nodelete_resource.erl | ||
rest_simple_resource.erl | ||
websocket_echo_handler.erl | ||
websocket_handler.erl | ||
websocket_handler_init_shutdown.erl | ||
ws_SUITE.erl | ||
ws_timeout_hibernate_handler.erl |