In catacumba, how could I receive the ip of an http request?
@niwinz maybe you can help ⏫ ?
Can somebody help me with this: In catacumba, how can I retrieve the ip of an http request?
isn’t a request there just a map?
does it have a remote-host key or something like that?
there is a request which is a map
but no ip there
there is {:catacumba/context #object[ratpack.handling.internal.DefaultContext 0x72d25b“ratpack.handling.internal.DefaultContext@72d25b”}]
inside the request
map
@dm3 maybe from the ratpack DafaultContext object, we can get the ip?
hi
I'm getting a weird error from a for
nested within an alet
[sorry, warning]
WARNING: Can't take value of macro cljs.core/for at line 133 src/speako/backend.cljs
WARNING: Use of undeclared Var speako.backend/entity at line 133 src/speako/backend.cljs
WARNING: Use of undeclared Var speako.backend/fields at line 133 src/speako/backend.cljs
nil
here's the relevant form:
(p/alet [entities (:objects parsed)
promises (for [[entity fields] entities]
(p/alet [table-name (entity->table-name entity)
columns-meta (p/await (table->columns table-name db))]
(scalar-columns-exist? table-name fields columns-meta db)))
res (p/await (p/all promises))]
(every? identity res))
the code actually works at runtime but I'm more of a "zero warning" kind of guy
and would like to avoid this warning without resulting to changing the for
to a map
johanatan: that’s a bug in alet
, you can try tackling if you’re feeling adventurous 🙂
@viebel did you try (.getRemoteHost (.getRequest context))
?
@dm3 is the bug reported anywhere?
no idea