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

net/http: font version returns internal server error 500 #18731

spiritedfang opened this issue Jan 20, 2017 · 2 comments

net/http: font version returns internal server error 500 #18731

spiritedfang opened this issue Jan 20, 2017 · 2 comments


Copy link

@spiritedfang spiritedfang commented Jan 20, 2017

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?

  1. Created a web server:
  2. Downloaded and hosted the following demo:
  3. Connected browser to localhost:8080.
  4. Observed internal server errors (500) for fonts which define a version. Example: url('../fonts/fontawesome-webfont.eot?v=4.6.3');
  5. Removed font version query in css (./vendor/font-awesome/css/font-awesome.min.css), observed working behaviour.

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:

What did you see instead?

Version query did not resolve and threw an internal server error (500).


As shown below, I was using the URI rather than the URL.Path. Correcting the usage fixed this issue. Thanks for pointing this out.

Copy link

@bradfitz bradfitz commented Jan 20, 2017

Your handler has a bug. RequestURI includes the query string. The docs at say:

        // RequestURI is the unmodified Request-URI of the
        // Request-Line (RFC 2616, Section 5.1) as sent by the client
        // to a server. Usually the URL field should be used instead.

For questions about Go, see

@bradfitz bradfitz closed this Jan 20, 2017
Copy link

@spiritedfang spiritedfang commented Jan 20, 2017

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.

@golang golang locked and limited conversation to collaborators Jan 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants