Skip to content

net/url: URL.String can return invalid string if given invalid URL.Path #5927

@eaigner

Description

@eaigner
When a path is set on a URL without a leading slash, String() does not add one

http://play.golang.org/p/AQR3kXpXrf

I don't know if is intended behavior, but it I guess it would be better handled with
automatically pre-pending the slash since the documentation for this function also states

    "String reassembles the URL into a valid URL string."

which is obviously not the case here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions