mirror of
https://gitlab.com/keys.openpgp.org/hagrid.git
synced 2025-10-06 00:23:08 +02:00
@@ -79,18 +79,23 @@ location /vks/v1/ {
|
|||||||
|
|
||||||
# Common HKP requests.
|
# Common HKP requests.
|
||||||
location /pks/lookup {
|
location /pks/lookup {
|
||||||
# rewrite this to a path we can match on (right below)
|
if ($arg_op !~ "^index|get$") {
|
||||||
if ($args ~ "op=.*search=") {
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
# urldecode the search parameter
|
error_page 400 /errors-static/400-pks-invalid.htm;
|
||||||
set_by_lua $arg_search_decoded "return ngx.arg[1]:gsub(\"%%(%x%x)\", function(x) return string.char(tonumber(x, 16)) end)" $arg_search;
|
return 400;
|
||||||
# if the search argument contains angle brackets, strip everything around them
|
}
|
||||||
set_by_lua $arg_search_decoded "return ngx.arg[1]:gsub(\"^.*<([^>]-)>.*$\", \"%1\")" $arg_search_decoded;
|
if ($arg_search = '') {
|
||||||
rewrite . /pks/internal/$arg_op/$arg_search_decoded last;
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
|
error_page 400 /errors-static/400-pks-invalid.htm;
|
||||||
|
return 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
# rewrite this to a path we can match on (right below)
|
||||||
error_page 400 /errors-static/400-pks-invalid.htm;
|
# urldecode the search parameter
|
||||||
return 400;
|
set_by_lua $arg_search_decoded "return ngx.arg[1]:gsub(\"%%(%x%x)\", function(x) return string.char(tonumber(x, 16)) end)" $arg_search;
|
||||||
|
# if the search argument contains angle brackets, strip everything around them
|
||||||
|
set_by_lua $arg_search_decoded "return ngx.arg[1]:gsub(\"^.*<([^>]-)>.*$\", \"%1\")" $arg_search_decoded;
|
||||||
|
rewrite . /pks/internal/$arg_op/$arg_search_decoded last;
|
||||||
}
|
}
|
||||||
|
|
||||||
# WKD requests
|
# WKD requests
|
||||||
|
Reference in New Issue
Block a user