Skip to content

net/url: Parse improperly fixes url #9216

@gopherbot

Description

@gopherbot

by apoydence:

What happened?
 - net/url doesn't properly "correct" a malformed URL. 

x, _ := url.Parse("http:/localhost:9999/a")
println(x.String()) // outputs: http:///localhost:9999/a

What should have happened instead?
 - It should either output an error, or output "http://localhost:9999/a

Playground:
https://play.golang.org/p/HkSSHIxAPW

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions