Skip to content

Commit

Permalink
fix(core): skip using redirect as site url if it's for a file
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed May 10, 2023
1 parent e2a29f9 commit 089368d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const validateHost = async (resolvedConfig: ResolvedUserConfig) => {
process.exit(1)
}
else if (response) {
// change the URL to the redirect one
if (redirected && redirectUrl) {
// change the URL to the redirect one, make sure it's not to a file (i.e /index.php)
if (redirected && redirectUrl && !redirectUrl.includes('.')) {
logger.success(`Request to site \`${resolvedConfig.site}\` redirected to \`${redirectUrl}\`, using that as the site.`)
resolvedConfig.site = normaliseHost(redirectUrl)
}
Expand Down

0 comments on commit 089368d

Please sign in to comment.