Skip to content

net/http: update the IDNA implementation from x/text #17268

Closed
@bradfitz

Description

@bradfitz

Opening this bug for @mpvl to sanity check the new net/http implementation of IDNA.

It's all been committed. See func idnaASCII in net/http/request.go:

func idnaASCII(v string) (string, error) {
        if isASCII(v) {
                return v, nil
        }
        // The idna package doesn't do everything from                                                                                  
        // https://tools.ietf.org/html/rfc5895 so we do it here.                                                                        
        // TODO(bradfitz): should the idna package do this instead?                                                                     
        v = strings.ToLower(v)
        v = width.Fold.String(v)
        v = norm.NFC.String(v)
        return idna.ToASCII(v)
}

I'm not a domain expert.

In particular, do we do what Chrome and Firefox do? A user should be able to type in any case with any widths in their URL bar (or in an HTML file's <a href="....."> attribute) and they should all canonicalize the same way.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions