Skip to content

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

Closed
@spiritedsnowcat

Description

@spiritedsnowcat

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: https://play.golang.org/p/wgGzWTuhoV
  2. Downloaded and hosted the following demo: https://startbootstrap.com/template-overviews/sb-admin-2/
  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: 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions