mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
🐛 Make nitrate calls skip ssrf-check
This commit is contained in:
parent
14b53ecfec
commit
ead9bd9ccc
@ -29,14 +29,16 @@
|
|||||||
(defn- request-builder
|
(defn- request-builder
|
||||||
[cfg method uri shared-key profile-id request-params]
|
[cfg method uri shared-key profile-id request-params]
|
||||||
(fn []
|
(fn []
|
||||||
(http/req cfg (cond-> {:method method
|
(http/req cfg
|
||||||
:headers {"content-type" "application/json"
|
(cond-> {:method method
|
||||||
"accept" "application/json"
|
:headers {"content-type" "application/json"
|
||||||
"x-shared-key" shared-key
|
"accept" "application/json"
|
||||||
"x-profile-id" (str profile-id)}
|
"x-shared-key" shared-key
|
||||||
:uri uri
|
"x-profile-id" (str profile-id)}
|
||||||
:version :http1.1}
|
:uri uri
|
||||||
(= method :post) (assoc :body (json/encode request-params :key-fn json/write-camel-key))))))
|
:version :http1.1}
|
||||||
|
(= method :post) (assoc :body (json/encode request-params :key-fn json/write-camel-key)))
|
||||||
|
{:skip-ssrf-check? true})))
|
||||||
|
|
||||||
(defn- with-retries
|
(defn- with-retries
|
||||||
[handler max-retries]
|
[handler max-retries]
|
||||||
@ -60,12 +62,13 @@
|
|||||||
(fn []
|
(fn []
|
||||||
(let [response (handler)
|
(let [response (handler)
|
||||||
status (:status response)]
|
status (:status response)]
|
||||||
(when-not status
|
|
||||||
(l/error :hint "could't do the nitrate request, it is probably down"
|
|
||||||
:uri uri)
|
|
||||||
;; TODO decide what to do when Nitrate is inaccesible
|
|
||||||
nil)
|
|
||||||
(cond
|
(cond
|
||||||
|
(nil? status)
|
||||||
|
(do
|
||||||
|
(l/error :hint "could't do the nitrate request, it is probably down"
|
||||||
|
:uri uri)
|
||||||
|
;; TODO decide what to do when Nitrate is inaccesible
|
||||||
|
nil)
|
||||||
(>= status 400)
|
(>= status 400)
|
||||||
;; For error status codes (4xx, 5xx), fail immediately without validation
|
;; For error status codes (4xx, 5xx), fail immediately without validation
|
||||||
(do
|
(do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user