-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Description
If I run this command, I get encoded output:
> xh -h https://wiktionary.org/wiki/Ῥόδος
HTTP/2.0 301 Moved Permanently
location: "https://www.wiktionary.org/wiki/\xe1\xbf\xac\xcf\x8c\xce\xb4\xce\xbf\xcf\x82"
but with this Go code:
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("HEAD", os.Args[1], nil)
res, _ := new(http.Transport).RoundTrip(req)
println(res.Header.Get("location"))
}
I get expected output:
> go run http.go https://wiktionary.org/wiki/Ῥόδος
https://www.wiktionary.org/wiki/Ῥόδος
https://wikipedia.org/wiki/Internationalized_Resource_Identifier
Metadata
Metadata
Assignees
Labels
No labels