This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-18
Channels
- # announcements (18)
- # babashka (34)
- # beginners (47)
- # biff (1)
- # calva (99)
- # cider (1)
- # clojure (99)
- # clojure-austin (13)
- # clojure-australia (1)
- # clojure-dev (53)
- # clojure-europe (30)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-spec (7)
- # clojure-uk (1)
- # clojurescript (50)
- # cursive (11)
- # datahike (20)
- # datomic (10)
- # fulcro (7)
- # graalvm (8)
- # gratitude (1)
- # introduce-yourself (7)
- # jackdaw (1)
- # joyride (1)
- # lambdaisland (7)
- # lsp (2)
- # malli (7)
- # nbb (1)
- # off-topic (1)
- # portal (24)
- # re-frame (8)
- # reagent (13)
- # reitit (7)
- # releases (2)
- # remote-jobs (8)
- # rewrite-clj (3)
- # sci (1)
- # scittle (21)
- # shadow-cljs (2)
- # testing (3)
- # tools-deps (22)
- # web-security (19)
Jo I'm implementing a :http-direct
function using ring
and there is an issue where ring.middleware.cookies
returns a lazy seq (the "Set-Cookie" header value is a seq), but cognitect.http_endpoint.jetty
expects a string - class clojure.lang.LazySeq cannot be cast to class java.lang.String
["cognitect.http_endpoint.jetty$respond_bbuf_STAR_",
"invokeStatic", "jetty.clj", 342]}],
do you have advice on how to fix? I can of course coerce the seq into a string before returning in my handler(defn- set-cookies
"Add a Set-Cookie header to a response if there is a :cookies key."
[response encoder]
(if-let [cookies (:cookies response)]
(update-in response
[:headers "Set-Cookie"]
concat
(doall (write-cookies cookies encoder)))
response))
This is an issue that is ion specific; you'll find that library works well enough in all the other ring servers. I just looked up our middleware for cookies on ion: Here is ours:
(defn wrap-http-direct [handler]
(fn [req]
(let [resp (handler req)]
(if (contains? (:headers resp) "Set-Cookie")
(update-in resp [:headers "Set-Cookie"] (fn [c]
(cond
(string? c) c
(seq c) (str/join "," c)
:else nil)))
resp))))
I think this library can give you the same thing (but packaged as a lib...)
;; [net.icbink.expand-headers.core :as ion-cookies]
;; from net.icbink/expand_headers {:git/url ""
;; :sha "b2b0364422d71b8f233148942618b7b16da38ecf"}
Hi! Has anyone here any experience of not being able to connect to Datomic again after querying after too much data?
On-prem? Cloud? What error do you get? Your transactor still running? Did the peer OOM?
Hello. I'm trying to use with
(as per https://docs.datomic.com/client-api/datomic.client.api.async.html#var-with) with :db/retractEntity
, and the call never returns - just times out. Is this supposed to work? It does seem to work when I add attributes, so am just wondering if this is just not possible, or something else is going on here. Thanks in advance.
FWIW - it does work mostly now. We think we have a dodgy query node 😬 Sorry for the noise.
How do i use an aws role that has all the permissions to ensure an on-prem datomic transactor? https://forum.datomic.com/t/how-to-pass-ensure-transactor-fn-an-aws-role/2142.