Skip to content

net/url: JoinPath generates bad path if initial url path is empty string #58605

Open
@perj

Description

@perj

What version of Go are you using (go version)?

$ go version
go version go1.20.1 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOOS="linux"

What did you do?

https://go.dev/play/p/wXMvYKC1FSY

What did you expect to see?

200 OK

What did you see instead?

400 Bad Request

The request sent to the server starts with GET api/endpoint. It should be GET /api/endpoint. The former generates a 400 error in url.ParseRequestURI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions