Skip to content

Commit

Permalink
chore: change proxy referrer config
Browse files Browse the repository at this point in the history
To avoid an csrf issue when proxying to https
  • Loading branch information
kelsos committed Dec 15, 2023
1 parent ec5910f commit 27cd666
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ const domain = process.env.PROXY_DOMAIN || 'localhost';
const insecureProxy = process.env.PROXY_INSECURE;
const proxyProtocol = insecureProxy === 'true' ? 'http' : 'https';
const baseUrl = `${proxyProtocol}://${domain}`;
const referrer = insecureProxy ? baseUrl : `${baseUrl}:443`;

const proxy = {
host: domain,
referrer: baseUrl,
referrer,
target: `${baseUrl}/webapi`,
};

Expand Down

0 comments on commit 27cd666

Please sign in to comment.