Skip to content

Commit

Permalink
Merge branch 'release/2024-11' of github.com:os2ulf/os2udoglaer-front…
Browse files Browse the repository at this point in the history
…end into release/2024-11
  • Loading branch information
tutaru99 committed Dec 3, 2024
2 parents d3b4a87 + b68a5e7 commit e261350
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions composables/useGetCurrentDomain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@ export default function useGetCurrentDomain() {

if (process.server) {
const hostHeader = useRequestHeaders();
currentDomain = hostHeader['x-forwarded-host'] || hostHeader.host;

if (
!currentDomain.startsWith('http://') ||
!currentDomain.startsWith('https://')
) {
currentDomain = 'https://' + currentDomain;
}
const rawDomain = hostHeader['x-forwarded-host'] || hostHeader.host || '';
currentDomain = `https://${rawDomain}`;
} else if (process.client) {
currentDomain = window.location.protocol + '//' + window.location.hostname;
const rawDomain = window.location.hostname;
currentDomain = `https://${rawDomain}`;
}

return currentDomain;
}
}

0 comments on commit e261350

Please sign in to comment.