net/http: font version returns internal server error 500 #18731
Closed
Labels
Comments
Your handler has a bug. RequestURI includes the query string. The docs at https://golang.org/pkg/net/http/#Request say:
For questions about Go, see https://golang.org/wiki/Questions. |
You were right. Changing my usage of RequestURI to URL.Path resolved this problem. I'm surprised the CSS call worked at all with URI. Thanks for the correction and pointer. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.7.1 windows/amd64
Edit: also occurs in 1.7.4
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
What did you do?
What did you expect to see?
Web packages (such as font-awesome) using font versioning queries resolves correctly for downloaded font css packages (using ?v=#), similarly to how css queries resolve (for example: https://fonts.googleapis.com/icon?family=Material+Icons).
What did you see instead?
Version query did not resolve and threw an internal server error (500).
Resolution
As shown below, I was using the URI rather than the URL.Path. Correcting the usage fixed this issue. Thanks for pointing this out.
The text was updated successfully, but these errors were encountered: