mirror of
https://github.com/penpot/penpot.git
synced 2025-01-08 07:50:43 -05:00
🐛 Fix ip-addr parsing issue when it comes with port
This commit is contained in:
parent
f4b59cc5a0
commit
a54160965d
1 changed files with 7 additions and 3 deletions
|
@ -35,9 +35,13 @@
|
|||
|
||||
(defn parse-client-ip
|
||||
[request]
|
||||
(or (some-> (rreq/get-header request "x-forwarded-for") (str/split ",") first)
|
||||
(rreq/get-header request "x-real-ip")
|
||||
(some-> (rreq/remote-addr request) str)))
|
||||
(let [ip-addr (or (some-> (rreq/get-header request "x-forwarded-for") (str/split ",") first)
|
||||
(rreq/get-header request "x-real-ip")
|
||||
(some-> (rreq/remote-addr request) str))
|
||||
ip-addr (-> ip-addr
|
||||
(str/split ":" 2)
|
||||
(first))]
|
||||
ip-addr))
|
||||
|
||||
(defn extract-utm-params
|
||||
"Extracts additional data from params and namespace them under
|
||||
|
|
Loading…
Reference in a new issue