GZipped files with undetected mimetype incorrectly served as "application/x-gzip"
Take this example repo:
.
├── .gitlab-ci.yml
└── public
├── test.blabla
└── test.blabla.gz
When I request the file test.blabla
without compression, then the content-type "text/plain" is returned, which I guess is a fallback.
But when I request it with compression then the content-type "application/x-gzip" is returned. That's not correct because the content-type hasn't changed, only the content-encoding has.
Expected behaviour:
The response header content-type
for unknown mimetypes should be the fallback value (e.g. "text/plain") even when requested with compression.
Actual behaviour:
The response header content-type
for files with unknown mimetype is "application/x-gzip" when requested with compression.
curl -si 'https://njam.gitlab.io/test-gitlab-pages-gz-mimetype/test.blabla' --compressed
...
content-type: application/x-gzip
...
See also this stackoverflow thread on the topic.