diff --git a/libs/client/src/response.ts b/libs/client/src/response.ts index e972659..b0ee0c7 100644 --- a/libs/client/src/response.ts +++ b/libs/client/src/response.ts @@ -11,6 +11,7 @@ export class ApiError extends Error { public readonly body?: any; constructor({ message, status, body }: ApiErrorArgs) { super(message); + this.name = 'ApiError'; this.status = status; this.body = body; } diff --git a/libs/nextjs/package.json b/libs/nextjs/package.json index 55ead0b..f0be04e 100644 --- a/libs/nextjs/package.json +++ b/libs/nextjs/package.json @@ -1,7 +1,7 @@ { "name": "@fal-ai/serverless-nextjs", "description": "The fal-serverless Next.js integration", - "version": "0.2.2", + "version": "0.2.3", "license": "MIT", "repository": { "type": "git", diff --git a/libs/nextjs/src/handler.ts b/libs/nextjs/src/handler.ts index 007541f..42983a3 100644 --- a/libs/nextjs/src/handler.ts +++ b/libs/nextjs/src/handler.ts @@ -83,7 +83,7 @@ export const handler: NextApiHandler = async (request, response) => { method: request.method, headers: { ...headers, - authorization: `Key ${falKey}`, + authorization: getHeader(request, 'authorization') ?? `Key ${falKey}`, accept: 'application/json', 'content-type': 'application/json', 'x-fal-client-proxy': '@fal-ai/serverless-nextjs',