mirror of
https://gitlab.com/keys.openpgp.org/hagrid.git
synced 2025-10-06 00:23:08 +02:00
rewrite requests to workaround angular bracket issue
unescaped angular brackets aren't allowed, but used by gnupg. this causes issues with Rocket that we can't fix in Hagrid. see https://gitlab.com/sequoia-pgp/hagrid/issues/94 upstream rocket bug https://github.com/SergioBenitez/Rocket/pull/941#issuecomment-492035708
This commit is contained in:
@@ -73,6 +73,18 @@ location /pks/lookup {
|
|||||||
rewrite . /vks/v1/by-email/$email last;
|
rewrite . /vks/v1/by-email/$email last;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# gpg --search '<address@example.org>'
|
||||||
|
# strip angle brackets - we don't need them, but they cause issues
|
||||||
|
# with the Rocket framework
|
||||||
|
# see https://gitlab.com/sequoia-pgp/hagrid/issues/94
|
||||||
|
if ($request_uri ~ "^/pks/lookup\?(.*)\<(.+)\>(.*)") {
|
||||||
|
set $left $1;
|
||||||
|
set $middle $2;
|
||||||
|
set $right $3;
|
||||||
|
set $args "";
|
||||||
|
rewrite . /pks/lookup?$left$middle$right? break;
|
||||||
|
}
|
||||||
|
|
||||||
# forward to backend, which will like serve via x-accel-redirect
|
# forward to backend, which will like serve via x-accel-redirect
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
proxy_pass http://127.0.0.1:8080;
|
proxy_pass http://127.0.0.1:8080;
|
||||||
|
Reference in New Issue
Block a user