Skip to content

Commit

Permalink
Print ut litt i proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
almyy committed Dec 6, 2024
1 parent 7047813 commit 80d61e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/[locale]/soknad-api/[...path]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ type ProxyRequestHandler = (request: Request, context: ProxyRequestContext) => P

const getRouteHandlerProxyTarget = (headers: Headers, requestPath: string[]): RouteHandlerProxyTarget => {
if (!digisosConfig.proxy) throw new Error("Proxy not configured");
console.log("arg", requestPath);
const {hostname, basePath, https} = digisosConfig.proxy;
const path = `${basePath}/${requestPath.join("/")}`;
console.log("path", path);
const bearerToken = `${headers.get("Authorization")?.split(" ")[1]}`;
return {hostname, path, bearerToken, https};
};
Expand Down

0 comments on commit 80d61e1

Please sign in to comment.