Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support unix sockets (hackney 1.6.2) #185

Closed
rhruiz opened this issue Oct 25, 2016 · 2 comments
Closed

Support unix sockets (hackney 1.6.2) #185

rhruiz opened this issue Oct 25, 2016 · 2 comments

Comments

@rhruiz
Copy link
Contributor

rhruiz commented Oct 25, 2016

Hello,

hackney recently introduced support for making requests on unix sockets using the scheme http+unix://. The following code on base.ex prepends an extra http:// on the url breaking the request:

@doc false
def default_process_url(url) do
  case url |> String.slice(0, 8) |> String.downcase do
    "http://" <> _ -> url
    "https://" <> _ -> url
    _ -> "http://" <> url
  end
end

As a workaround, I can implement my own module with the HTTPoison.Base macro and override process_url.

Can we get that allowed on the default_process_url as well?

Thanks!

@edgurgel
Copy link
Owner

Definitely! Do you mind sending a PR for this change?

@rhruiz
Copy link
Contributor Author

rhruiz commented Oct 26, 2016

Sure thing, just had to add unix sockets to httparrot to write the tests: edgurgel/httparrot#23

I will send the PR next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants