From 5b91cc4e26e70e11c653e8e7f7eb9312c71766d1 Mon Sep 17 00:00:00 2001 From: Aaron Dixon Date: Thu, 5 Jan 2023 10:11:17 -0600 Subject: [PATCH] Minor --- conf/relay.yaml | 3 ++- src/me/untethr/nostr/jetty.clj | 8 ++++++-- src/me/untethr/nostr/page/metrics_porcelain.clj | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/conf/relay.yaml b/conf/relay.yaml index f17b236..62b4210 100644 --- a/conf/relay.yaml +++ b/conf/relay.yaml @@ -20,7 +20,8 @@ max-content-length: 1048576 # epoch millis *plus* this delta will be accepted. max-created-at-delta: 2700 +# Optional websockets config. websockets: max-outgoing-frames: 5000 disable-permessage-deflate: false - enable-batch-mode: true + enable-batch-mode: false diff --git a/src/me/untethr/nostr/jetty.clj b/src/me/untethr/nostr/jetty.clj index 3a95bd0..a0f7b6d 100644 --- a/src/me/untethr/nostr/jetty.clj +++ b/src/me/untethr/nostr/jetty.clj @@ -117,9 +117,13 @@ ;; for non-websocket requests, we expect an earlier handler to handle "/" ;; so this is unexpected... (log/warn "unexpected request" - {:request-url (.getRequestURL req) + {:request-url (str (.getRequestURL req)) :selected-headers {:connection - (.getHeader req "Connection")}}) + (.getHeader req "Connection") + :upgrade + (.getHeader req "Upgrade") + :header-names + (vec (enumeration-seq (.getHeaderNames req)))}}) (update-response! resp {:status 404})))))) (defn- disable-default-servlet! diff --git a/src/me/untethr/nostr/page/metrics_porcelain.clj b/src/me/untethr/nostr/page/metrics_porcelain.clj index c528234..bff72a3 100644 --- a/src/me/untethr/nostr/page/metrics_porcelain.clj +++ b/src/me/untethr/nostr/page/metrics_porcelain.clj @@ -54,7 +54,7 @@ (let [m (.getMetrics x) used-bytes (value-of (.get m "total.used")) max-bytes (value-of (.get m "total.max")) - percentage (* 100 (long (/ used-bytes max-bytes)))] + percentage (long (* 100 (/ used-bytes max-bytes)))] [:span [:b (long (/ used-bytes 1000000))] "M / " [:b (long (/ max-bytes 1000000))] "M (" percentage "%)"]))