This is a sample app to investigate the behavior of mime.TypeByExtension() on a variety of platforms and go versions.
It is being used to investigate the following issue: gofiber/fiber#2383
In GoFiber/Fiber, the following code is used:
c.Request().Header.Set(HeaderAccept, "text/*, application/json")
c.Accepts("json", "text") // should return "json", but on local macOS returns "text"
Passes on all versions of go.
Passes on all versions of go.
Passes on all versions of go.
Fails on go 1.20.2 with the following error:
=== RUN TestAccepts
main_test.go:13: mimetype is text/plain; charset=utf-8, want application/json
--- FAIL: TestAccepts (0.00s)
FAIL
FAIL github.com/sixcolors/textmime 0.329s
FAIL
Fails on go 1.20.2 with the following error:
=== RUN TestAccepts
main_test.go:13: mimetype is text/plain; charset=utf-8, want application/json
--- FAIL: TestAccepts (0.01s)
FAIL
FAIL github.com/sixcolors/textmime 0.016s
FAIL
The following observations were made:
- On a local macOS machine, the file extension "text" is associated with the mime type "text/plain".
- The application that registers "text" is /Applications/TextEdit.app which is a default macOS application.
- This application is not installed on the CI machines.