Skip to content

Commit

Permalink
fix proper host
Browse files Browse the repository at this point in the history
  • Loading branch information
alweber-cap committed Jan 30, 2025
1 parent e0c6d90 commit ed85c4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helpers/redirect.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const url = require('url');
const sanitizeHtml = require('sanitize-html');
const SC_DOMAIN = require('../config/global');
const global = require('../config/global');

/**
* Collapse leading slashes to one slash to avoid redirects to other websides
Expand All @@ -18,7 +18,7 @@ const getValidRedirect = (redirectUrl) => {
if (!redirectUrl) return '/';
const sanitizedUrl = sanitizeHtml(redirectUrl);
let relativeUrl = '/';
const parsedUrl = URL.parse(sanitizedUrl, SC_DOMAIN);
const parsedUrl = URL.parse(sanitizedUrl, global.HOST);
if (parsedUrl) {
relativeUrl = url.format(parsedUrl, { search: true, fragment: true, unicode: true });
}
Expand Down

0 comments on commit ed85c4e

Please sign in to comment.