fix(transport): allow passwordless resource reads

This commit is contained in:
chick
2026-07-19 00:56:03 +08:00
parent 4e7bdea230
commit 38a26c2ce1
2 changed files with 20 additions and 2 deletions
@@ -55,8 +55,9 @@ export class SafeUpstreamGateway {
url.hash ||
url.username ||
url.password ||
typeof request.headers.cookie !== 'string' ||
!/^simadmin_session=[^;\s,]+$/.test(request.headers.cookie)
(request.headers.cookie !== undefined &&
(typeof request.headers.cookie !== 'string' ||
!/^simadmin_session=[^;\s,]+$/.test(request.headers.cookie)))
)
throw new UpstreamError('UPSTREAM_REQUEST_INVALID');
return this.options.transport.get(request.url, request.headers);