cpp-httplib
                                
                                 cpp-httplib copied to clipboard
                                
                                    cpp-httplib copied to clipboard
                            
                            
                            
                        Handling for URLs containing IPv6 addresses broken
Hello,
I noticed that the library cannot handle URLs like http://[::1]/ because it does not consider the []-escaped IPv6 addresses. It's a problem in both: the Client constructors as well as the Host:-HTTP header.
Thanks, Gregor
@gjasny, thanks for the report. I right now don't have time to work on it. If you have time, could you send me a pull request with a unit test case? Thanks!
Hello,
thanks for taking care. Unfortunately the Host header still looks wrong:
GET /cache/8e193hu1ntu7bvd6ohhsrncr94hibhn8s HTTP/1.1
Accept: */*
Host: ::1:8080
User-Agent: ccache/master.b7e6280e
Maybe you could use a dedicated URL class for parsing like: CxxUrl?
Thanks, Gregor
ipv6 must have [ ] in url or header
Open this issue again. A pull request is welcome!
https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers https://serverfault.com/questions/1026466/ipv6-address-text-notation-with-prefix-inside-or-outside-square-brackets
https://github.com/yhirose/cpp-httplib/blob/9e4f93d87e744c9038554d19f3837980959093e2/test/test.cc#L1597