Lagt på Host och Origin på anropet till apigw

This commit is contained in:
Kajetan Kazimierczak 2021-03-01 22:21:31 +01:00
parent 82af532685
commit 7642a90cd6
1 changed files with 5 additions and 1 deletions

View File

@ -147,10 +147,12 @@ export class Api extends EventEmitter {
const cdnResponse = await this.fetch('cdn', routes.cdn, this.session)
const cdn = await cdnResponse.text()
const cdnHost = new URL(cdn).host
const authResponse = await this.fetch('auth', routes.auth, this.session)
const auth = await authResponse.text()
const rawResponse = await this.fetch('createItem', cdn, {
method: 'POST',
@ -158,7 +160,9 @@ export class Api extends EventEmitter {
'Accept': 'text/plain',
'Access-Control-Allow-Origin': '*',
'Content-Type': 'text/plain',
'Cookie': this.getSessionCookie()
'Cookie': this.getSessionCookie(),
Host: cdnHost,
Origin: 'https://etjanst.stockholm.se'
},
body: auth
})