Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/pkgsite: trailing slash leads to "400 Bad Request" #44979

Closed
imjasonh opened this issue Mar 13, 2021 · 1 comment
Closed

x/pkgsite: trailing slash leads to "400 Bad Request" #44979

imjasonh opened this issue Mar 13, 2021 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite

Comments

@imjasonh
Copy link

What is the URL of the page with the issue?

https://pkg.go.dev/github.com/google/go-containerregistry@v0.4.1/pkg/v1/

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36

Screenshot

Screen Shot 2021-03-12 at 9 11 58 PM

What did you do?

I added a trailing / to the URL https://pkg.go.dev/github.com/google/go-containerregistry@v0.4.1/pkg/v1

What did you expect to see?

I expected to see it succeed and show documentation.

What did you see instead?

400 Bad Request


This seems potentially related to #43979, at least insofar as it's another bug with handling trailing slashes.

In general it's probably fine to just remove trailing slashes and handle the request the same, or even just redirect to the trailing-slashless URL

These both work:

This doesn't:

So it seems like it's specific to handling sub-packages in a module where the version is included in the URL.

@gopherbot gopherbot added this to the Unreleased milestone Mar 13, 2021
@jba jba added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 15, 2021
@jba jba modified the milestones: Unreleased, pkgsite/unplanned Mar 15, 2021
@gopherbot
Copy link

Change https://golang.org/cl/301869 mentions this issue: internal/frontend: fix 400 due to trailing slash

@golang golang locked and limited conversation to collaborators Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite
Projects
None yet
Development

No branches or pull requests

4 participants