• Brad Fitzpatrick's avatar
    net/http: make Transport support international domain names · b7e53038
    Brad Fitzpatrick authored
    This CL makes code like this work:
    
         res, err := http.Get("https://фу.бар/баз")
    
    So far, IDNA support is limited to the http1 and http2 Transports.
    The http package is currently responsible for converting domain names
    into Punycode before calling the net layer. The http package also has
    to Punycode-ify the hostname for the Host & :authority headers for
    HTTP/1 and HTTP/2, respectively.
    
    No automatic translation from Punycode back to Unicode is performed,
    per Go's historical behavior. Docs are updated where relevant.  No
    changes needed to the Server package. Things are already in ASCII
    at that point.
    
    No changes to the net package, at least yet.
    
    Updates x/net/http2 to git rev 57c7820 for https://golang.org/cl/29071
    
    Updates #13835
    
    Change-Id: I1e9a74c60d00a197ea951a9505da5c3c3187099b
    Reviewed-on: https://go-review.googlesource.com/29072Reviewed-by: 's avatarChris Broadfoot <cbro@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    b7e53038
transport_test.go 98.7 KB