Provide nicer filenames for downloads.

- This is especially useful for the HKP interface, where previously
    all downloads were named 'lookup'.
This commit is contained in:
Justus Winter 2019-02-26 12:30:42 +01:00 committed by Justus Winter
parent 2aed7802db
commit 4c10cbdb2f
No known key found for this signature in database
GPG Key ID: 686F55B4AB2B3386
1 changed files with 3 additions and 0 deletions

View File

@ -19,18 +19,21 @@ http {
location /by-email/ {
rewrite "^/by-email/([^/]{2})([^/]*)$" /by-email/$1/$2 break;
default_type application/pgp-keys;
add_header Content-Disposition 'attachment; filename="$1$2.asc"';
try_files /$uri =404;
}
location /by-fingerprint/ {
rewrite ^/by-fingerprint/(0x)?([^/][^/])(..*)$ $2/$3 break;
default_type application/pgp-keys;
add_header Content-Disposition 'attachment; filename="$2$3.asc"';
try_files /by-fpr/$uri =404;
}
location /by-keyid/ {
rewrite ^/by-keyid/(0x)?([^/][^/])(.*)$ /by-keyid/$2/$3 break;
default_type application/pgp-keys;
add_header Content-Disposition 'attachment; filename="$2$3.asc"';
try_files /$uri =404;
}