Thanks for the excellent library!
Two small things worth signalling which make it not a perfect drop-in:
In case the mime type cannot be determined from the extension by the mime.TypeByExtension method, ServeContent will try to infer from the actual file content: https://golang.org/src/net/http/fs.go?s=4932:5036#L198 so it will return a type like "application/x-gzip", whereas http.FileServer would have return "text/plain" for a YAML file, for example. This can lead to bugs, for example when trying to use the Swagger UI.
=> workaround: register such non-standard types (there's actually no official mime type for YAML):
mime.AddExtensionType(".yaml", "application/x-yaml")
http.FileServer can find a file requested as "static/test.html" (for example when using http.StripPrefix) whereas gzipped.FileServer requires the leading "/"
Thanks for the excellent library! Two small things worth signalling which make it not a perfect drop-in:
Thanks! Ben