[RFC] Archive Extensions and Mimes
-
I have summed up the feature in concise words in the Summary section. -
I have completely described the feature in the Description section.
Summary
We should host archive extensions in a better way.
Description
Currently, all archives are served with the .gz extension, but they're served with Content-Type: text/plain and Content-Encoding: gzip, which makes the .gz extension quite senseless.
We should modify how we treat archives depending on:
- Request path
- Requested
.gzextensionContent-Type: application/gzip- No
Content-Encoding
- Requested
.jsonextensionContent-Type: application/jsonContent-Encoding: gzip
- Requested
.txtextensionContent-Type: text/plainContent-Encoding: gzip
- Requested
Additionally, we may want to utilize the Content-Type and Accept-Encoding request headers.
Examples:
curl https://aur.archlinux.org/packages.gz
# application/gzip archive is downloaded with no decompression
curl --compressed https://aur.archlinux.org/packages.txt
# text/plain decompressed archive is downloaded over `gzip` encoded transport
curl https://aur.archlinux.org/packages-meta-v1.json.gz
# application/gzip archive is downloaded with no decompression
curl --compressed https://aur.archlinux.org/packages-meta-v1.json
# application/json decompressed archive is downloaded over `gzip` encoded transport
At this time, we have no other routes within aurweb which use the .gz, .json or .txt extensions, so this should be safe to use on AUR website.
Edited by Kevin Morris