When a visitor submit a form, I'd like to assoc to inputs his IP adress.
(POST "/form" {params :params} (assoc params :ip-address the-ip)
How to do this?
Thought of doing this:
(POST "/form" {params :params
client-ip :remote-addr}
(->> params keywordize-keys (merge {:ip-address client-ip}) str))
But this returns {... :ip-address "0:0:0:0:0:0:0:1"}
localhost
in ipv6. where does your request originate from?:remote-addr
form your answer, I suppose this is right.wrap-keyword-params
. stackoverflow.com/questions/26151801/…