Allow CORS backend option and fix frontend to allow it

This commit is contained in:
alonso.torres 2021-10-20 11:09:30 +02:00
parent f32f13069f
commit 007728819b
9 changed files with 80 additions and 18 deletions

View file

@ -7,6 +7,8 @@
(ns app.worker.thumbnails
(:require
["react-dom/server" :as rds]
[app.common.uri :as u]
[app.config :as cfg]
[app.main.exports :as exports]
[app.main.fonts :as fonts]
[app.util.http :as http]
@ -29,11 +31,15 @@
(defn- request-page
[file-id page-id]
(let [uri "/api/rpc/query/page"]
(let [uri (u/join (cfg/get-public-uri) "api/rpc/query/page")
params {:file-id file-id
:id page-id
:strip-thumbnails true}]
(->> (http/send!
{:uri uri
:query {:file-id file-id :id page-id :strip-thumbnails true}
:method :get})
{:method :get
:uri uri
:credentials "include"
:query params})
(rx/map http/conditional-decode-transit)
(rx/mapcat handle-response))))