edicl / drakma

HTTP client written in Common Lisp
http://edicl.github.io/drakma/
249 stars 59 forks source link

Wrong "Host:" header when accessing IPv6 resources by address #106

Closed phmarek closed 4 years ago

phmarek commented 4 years ago

Drakma sends eg. Host: ::1:9000 instead of Host: [::1]:9000 when accessing IPv6 hosts by address.

In my puri branch at git@common-lisp.net:pmarek/puri.git there's a public uri-is-ip6 accessor that specifies that the host part is an IPv6 IP, so simply adding conditionals in the request.lisp:682, (write-header "Host" "~A~@[:~A~]" ...) should be enough to make it work.

Thanks a lot!

stassats commented 4 years ago

What does your branch of puri has to do with it and can you turn your editing instructions into a diff?

phmarek commented 4 years ago

Upstream puri doesn't even know about IPv6 (see also https://gitlab.common-lisp.net/clpm/puri/-/issues/1).

See 6b2682e9594ee27e7fbf682bafd9f7880df4bbb6 for small change. (Do you want a PR?)

Thanks!

stassats commented 4 years ago

So how can I merge this if it doesn't use the upstream puri?

phmarek commented 4 years ago

Upstream now has the changes (http://git.kpe.io/?p=puri.git;a=commit;h=4bbab89d9ccbb26346899d1f496c97604fec567b).

stassats commented 4 years ago

Ok, now do a pull request, so that we'll know who to blame if things go wrong.

phmarek commented 4 years ago

Here you are, #107.

phmarek commented 4 years ago

Thanks!