Fix incompatibilities of front files server and datalake (#8730)

Signed-off-by: Nikolay Marchuk <nikolay.marchuk@hardcoreeng.com>
This commit is contained in:
Nikolay Marchuk 2025-04-28 19:02:29 +07:00 committed by GitHub
parent 76a425ba98
commit c28ead7a03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -458,9 +458,12 @@ export function start (
try { try {
const cookies = ((req?.headers?.cookie as string) ?? '').split(';').map((it) => it.trim().split('=')) const cookies = ((req?.headers?.cookie as string) ?? '').split(';').map((it) => it.trim().split('='))
const authorization = ((req?.headers?.authorization as string) ?? '').split(' ')
const authorizationToken = authorization.at(0)?.toLowerCase() === 'bearer' ? authorization.at(1) : undefined
const token = const token =
cookies.find((it) => it[0] === 'presentation-metadata-Token')?.[1] ?? cookies.find((it) => it[0] === 'presentation-metadata-Token')?.[1] ??
(req.query.token as string | undefined) ?? (req.query.token as string | undefined) ??
authorizationToken ??
'' ''
const wsIds = await getWorkspaceIds(ctx, token, req.path) const wsIds = await getWorkspaceIds(ctx, token, req.path)
if (wsIds === null) { if (wsIds === null) {
@ -489,6 +492,7 @@ export function start (
'accept-ranges': 'bytes', 'accept-ranges': 'bytes',
connection: 'keep-alive', connection: 'keep-alive',
'Keep-Alive': 'timeout=5', 'Keep-Alive': 'timeout=5',
'content-type': blobInfo.contentType,
'content-length': blobInfo.size, 'content-length': blobInfo.size,
'content-security-policy': "default-src 'none';", 'content-security-policy': "default-src 'none';",
Etag: blobInfo.etag, Etag: blobInfo.etag,