Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SKS Keyserver v1.1.5 patch to change the downloadable "pgpkey.asc" file to a txt file, viewable in a web browser.
---
dbserver.ml | 2 +-
wserver.ml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dbserver.ml b/dbserver.ml
index 583c484..7c2b926 100644
--- a/dbserver.ml
+++ b/dbserver.ml
@@ -261,7 +261,7 @@ struct
else Armor.encode_pubkey_string (Key.to_string_multiple keys)
in
if request.machine_readable then
- ("application/pgp-keys; charset=UTF-8", count, aakeys)
+ ("text/plain; charset=UTF-8", count, aakeys)
else
("text/html; charset=UTF-8",
count,
diff --git a/wserver.ml b/wserver.ml
index 6ccfc62..b758084 100644
--- a/wserver.ml
+++ b/wserver.ml
@@ -305,7 +305,7 @@ let send_result cout ?(error_code = 200) ?(content_type = "text/html; charset=UT
* This should probably be passed down in the request itself.
*)
if content_type = "application/pgp-keys; charset=UTF-8" then
- fprintf cout "Content-disposition: attachment; filename=gpgkey.asc\r\n";
+ fprintf cout "Content-disposition: attachment; filename=gpgkey.txt\r\n";
(*
* Allow access from Javascript code on other sites.
* For details, see https://en.wikipedia.org/wiki/Cross-origin_resource_sharing.
--
1.9.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.