This commit is contained in:
@@ -55,7 +55,7 @@ async function proxy(request: NextRequest) {
|
||||
// does). X-Forwarded-For is deliberately ignored: its leftmost entry is
|
||||
// client-controlled. backendFetch adds the timestamped HMAC signature.
|
||||
const clientIP = observedClientIP(request.headers)
|
||||
if (clientIP) headers.set('x-computer-client-ip', clientIP)
|
||||
if (clientIP) headers.set('x-superbrain-client-ip', clientIP)
|
||||
if (!['GET', 'HEAD'].includes(request.method)) {
|
||||
const declared = Number(request.headers.get('content-length') || 0)
|
||||
if (declared > MAX_BODY_BYTES) {
|
||||
|
||||
@@ -33,7 +33,7 @@ export async function POST(req: Request) {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
// Same short-lived assertion the data proxy signs (lib/api.ts).
|
||||
Authorization: `Bearer ${jwt.sign({ uid: id, ver, typ: 'assertion' }, secret, { algorithm: 'HS256', issuer: 'computer', expiresIn: '60s' })}`,
|
||||
Authorization: `Bearer ${jwt.sign({ uid: id, ver, typ: 'assertion' }, secret, { algorithm: 'HS256', issuer: 'superbrain', expiresIn: '60s' })}`,
|
||||
},
|
||||
cache: 'no-store',
|
||||
signal: controller.signal,
|
||||
|
||||
Reference in New Issue
Block a user