hackney icon indicating copy to clipboard operation
hackney copied to clipboard

redirect to relative url with proxy fails

Open ananthakumaran opened this issue 7 years ago • 4 comments

** (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.

ananthakumaran avatar Jan 02 '17 04:01 ananthakumaran

Hi Any news about issue ?

yurgon avatar Mar 05 '18 05:03 yurgon

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 😬

Hugo-Hache avatar Sep 06 '18 13:09 Hugo-Hache

@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? 🤔

sreecodeslayer avatar Oct 09 '20 08:10 sreecodeslayer

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

ananthakumaran avatar Oct 09 '20 12:10 ananthakumaran