golang / gddo

Go Doc Dot Org
https://godoc.org
BSD 3-Clause "New" or "Revised" License
1.1k stars 265 forks source link

Should Godoc.org error when query params are added? #500

Closed joncalhoun closed 6 years ago

joncalhoun commented 7 years ago

I was writing an email with a link to the cmp package (http://godoc.org/github.com/google/go-cmp/cmp) using Drip.co and when I sent myself a test email they added on a random URL query param - http://godoc.org/github.com/google/go-cmp/cmp?__s=XXXXXXXX

When I visit the first link everything works, but the second errors. Is this intentional?

dmitshur commented 7 years ago

That feels like a bug to me. I think unknown/unsupported queries should either be ignored, or the error message should mention "unrecognized query parameters". It currently says "Not Found" as if the repository is not found, that's not accurate.

As a data point, github.com ignores unknown queries. E.g., the following URLs take you here and works fine:

https://github.com/golang/gddo/issues/500?__s=XXXXXXXX
https://github.com/golang/gddo/issues/500?__definitelyunknownandunsupportedparam=XXXXXXXX
dmitshur commented 6 years ago

Reopening for deploy and to verify the fix works as expected.

shantuo commented 6 years ago

Thanks for the change @m90 ! Just deployed a new version and switched it to default.