Bump CACHEBUST to v8 for backend and frontend rebuilds; update Nginx and NostrAuthGuard to handle X-Forwarded-Prefix for NIP-98 compliance
This commit is contained in:
@@ -88,9 +88,15 @@ export class NostrAuthGuard extends AuthGuard('nostr') {
|
||||
'http';
|
||||
const host =
|
||||
request.get('host') ?? request.headers.host ?? request.hostname;
|
||||
|
||||
// When behind a reverse proxy that strips a path prefix (e.g. /api),
|
||||
// the proxy should forward X-Forwarded-Prefix so we can reconstruct
|
||||
// the original URL that the client signed in its NIP-98 event.
|
||||
const prefix =
|
||||
(request.headers['x-forwarded-prefix'] as string | undefined) ?? '';
|
||||
const path = request.originalUrl ?? request.url ?? '';
|
||||
|
||||
return `${protocolHeader}://${host}${path}`;
|
||||
return `${protocolHeader}://${host}${prefix}${path}`;
|
||||
}
|
||||
|
||||
private mapErrorToHttpException(error: NostrAuthError) {
|
||||
|
||||
Reference in New Issue
Block a user