branch: elpa/hyperdrive
commit cbe2a28041c0a98eff6726fdb11698bb05257877
Author: Joseph Turner <[email protected]>
Commit: Joseph Turner <[email protected]>
Fix: (h/write) Encode metadata JSON as UTF-8
Previously, the JSON object was uploaded with the internal Emacs
representation.
---
hyperdrive-lib.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 8300034c35..756db45326 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1325,7 +1325,9 @@ DEFAULT and INITIAL-INPUT are passed to `read-string'
as-is."
(declare (indent defun))
(let ((entry (he/create :hyperdrive hyperdrive
:path "/.well-known/host-meta.json")))
- (h/write entry :body (json-encode (h/metadata hyperdrive))
+ ;; TODO: Is it okay to always encode the JSON object as UTF-8?
+ (h/write entry :body (encode-coding-string
+ (json-encode (h/metadata hyperdrive)) 'utf-8)
:then then)
hyperdrive))