mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-27 11:06:50 +03:00
add cookies support for front import
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
ec5646504a
commit
15281ad833
@ -192,10 +192,19 @@ export function start (transactorEndpoint: string, elasticUrl: string, minio: Cl
|
||||
const token = authHeader.split(' ')[1]
|
||||
const payload = decode(token ?? '', 'secret', false) as Token
|
||||
const url = req.query.url as string
|
||||
const cookie = req.query.cookie as string | undefined
|
||||
|
||||
console.log('importing from ', url)
|
||||
|
||||
https.get(url, response => {
|
||||
const options = cookie !== undefined
|
||||
? {
|
||||
headers: {
|
||||
Cookie: cookie
|
||||
}
|
||||
}
|
||||
: {}
|
||||
|
||||
https.get(url, options, response => {
|
||||
console.log('status', response.statusCode)
|
||||
const id = uuid()
|
||||
const contentType = response.headers['content-type']
|
||||
|
Loading…
Reference in New Issue
Block a user