benoitc / hackney

simple HTTP client in Erlang
Other
1.34k stars 427 forks source link

redirect to relative url with proxy fails #376

Open ananthakumaran opened 7 years ago

ananthakumaran commented 7 years ago
** (FunctionClauseError) no function clause matching in :hackney_url.transport_scheme/1
    (hackney) ../deps/hackney/src/hackney_url.erl:107: :hackney_url.transport_scheme(:hackney_http_connect)
    (hackney) ../deps/hackney/src/hackney.erl:888: :hackney.absolute_url/2
    (hackney) ../deps/hackney/src/hackney.erl:738: :hackney.maybe_redirect/2
    (hackney) ../deps/hackney/src/hackney.erl:374: :hackney.send_request/2
    lib/httpoison/base.ex:402: HTTPoison.Base.request/9

This happens only on redirection to relative url with proxy option. Hackney tries to convert the relative url to absolute, but hackney_http_connect transport type is not handled in hackney_url module.

yurgon commented 6 years ago

Hi Any news about issue ?

Hugo-Hache commented 6 years ago

I have this exact same issue on my Elixir reverse proxy (using HTTPoison based on hackney). I'd like to help by opening by a PR, but I'm new to Elixir, and know even less about Erlang 😬

sreecodeslayer commented 4 years ago

@benoitc hey, were you able to work on this. we are having the exact issue as added on https://github.com/edgurgel/httpoison/issues/112#issuecomment-698842552 and is kinda blocking our flows. I would be happy to help out, although not entirely familiar with erlang.

@ananthakumaran were you able to work around this somehow? 🤔

ananthakumaran commented 4 years ago

I think we ended up handling redirect response ourselves instead of using follow_redirect.