@alpaca-headless/alpaca-headless-nextjs 1.0.3573 → 1.0.3576

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ export async function handleBasicAuthRoute({ request, mapHost, renderOptions, ap
8
8
  }
9
9
  const config = apiConfig || {};
10
10
  if (!config.headers) {
11
- config.headers = getApiHeaders();
11
+ config.headers = await getApiHeaders();
12
12
  }
13
13
  const routeData = await resolveRoute({
14
14
  path: request.nextUrl.pathname,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { EditorIntegration } from "./EditorIntegration";
2
- export declare function getApiHeaders(): Headers;
2
+ export declare function getApiHeaders(): Promise<Headers>;
3
3
  export { handleRequest } from "./middleware/handleRequest";
4
4
  export { proxy } from "./proxy";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { headers } from "next/headers";
2
2
  export { EditorIntegration } from "./EditorIntegration";
3
- export function getApiHeaders() {
4
- const requestHeaders = headers();
3
+ export async function getApiHeaders() {
4
+ const requestHeaders = await headers();
5
5
  const apiHeaders = new Headers();
6
6
  apiHeaders.set("Cookie", requestHeaders.get("Cookie") || "");
7
7
  apiHeaders.set("Authorization", requestHeaders.get("Authorization") || "");
@@ -8,7 +8,7 @@ export async function handleRequest({ request, mapHost, renderOptions, apiConfig
8
8
  }
9
9
  const config = apiConfig || {};
10
10
  if (!config.headers) {
11
- config.headers = getApiHeaders();
11
+ config.headers = await getApiHeaders();
12
12
  }
13
13
  const routeData = await resolveRoute({
14
14
  path: request.nextUrl.pathname,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpaca-headless/alpaca-headless-nextjs",
3
- "version": "1.0.3573",
3
+ "version": "1.0.3576",
4
4
  "type": "module",
5
5
  "description": "Alpaca Headless",
6
6
  "main": "dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "typescript": "^5"
51
51
  },
52
52
  "dependencies": {
53
- "@alpaca-headless/alpaca-headless": "^1.0.3573",
53
+ "@alpaca-headless/alpaca-headless": "^1.0.3576",
54
54
  "axios": "^1.7.2",
55
55
  "https-proxy-agent": "^7.0.4",
56
56
  "next": "^14.2.4",
@@ -25,7 +25,7 @@ export async function handleBasicAuthRoute({
25
25
 
26
26
  const config = apiConfig || {};
27
27
  if (!config.headers) {
28
- config.headers = getApiHeaders();
28
+ config.headers = await getApiHeaders();
29
29
  }
30
30
 
31
31
  const routeData = await resolveRoute({
package/src/index.ts CHANGED
@@ -2,8 +2,8 @@ import { headers } from "next/headers";
2
2
 
3
3
  export { EditorIntegration } from "./EditorIntegration";
4
4
 
5
- export function getApiHeaders() {
6
- const requestHeaders = headers();
5
+ export async function getApiHeaders() {
6
+ const requestHeaders = await headers();
7
7
  const apiHeaders = new Headers();
8
8
  apiHeaders.set("Cookie", requestHeaders.get("Cookie") || "");
9
9
  apiHeaders.set("Authorization", requestHeaders.get("Authorization") || "");
@@ -25,7 +25,7 @@ export async function handleRequest({
25
25
 
26
26
  const config = apiConfig || {};
27
27
  if (!config.headers) {
28
- config.headers = getApiHeaders();
28
+ config.headers = await getApiHeaders();
29
29
  }
30
30
 
31
31
  const routeData = await resolveRoute({