Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Changes for websites that do not redirect non www url to www url #248

Merged
merged 2 commits into from
May 8, 2024

Conversation

raji-unni
Copy link
Contributor

Please ensure your pull request adheres to the following guidelines:

  • make sure to link the related issues in this description
  • when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes

Related Issues

Thanks for contributing!

@raji-unni raji-unni requested a review from ekremney May 7, 2024 13:40
url: finalUrl,
};

const data = await rumAPIClient.getExperimentationData(params);
let data = await rumAPIClient.getExperimentationData(params);
if (data.length === 0 && !finalUrl.toLowerCase().startsWith('www')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!finalUrl.toLowerCase().startsWith('www') would also return true for sites with valid subdomains such as blog.adobe.com. We should also include it in the check, otherwise we may end up with something like www.blog.adobe.com > which is wrong

data.length === 0 && hasNonWWWSubdomain(baseURL) && !finalUrl.startsWith('www')`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorporated this.

const data = await rumAPIClient.getExperimentationData(params);
let data = await rumAPIClient.getExperimentationData(params);
if (data.length === 0 && !finalUrl.toLowerCase().startsWith('www')) {
finalUrl = 'www.'.concat(finalUrl);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use ES6 way of string concatenation:

finalUrl = `www.${finalUrl}`;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorporated this.

Copy link

github-actions bot commented May 8, 2024

This PR will trigger a patch release when merged.

@raji-unni raji-unni merged commit 088ad72 into main May 8, 2024
4 checks passed
@raji-unni raji-unni deleted the SITES-21790 branch May 8, 2024 08:53
solaris007 pushed a commit that referenced this pull request May 8, 2024
## [1.15.8](v1.15.7...v1.15.8) (2024-05-08)

### Bug Fixes

* Changes for websites that do not redirect non www url to www url ([#248](#248)) ([088ad72](088ad72))
solaris007 pushed a commit that referenced this pull request May 8, 2024
## [1.15.8](v1.15.7...v1.15.8) (2024-05-08)

### Bug Fixes

* Changes for websites that do not redirect non www url to www url ([#248](#248)) ([088ad72](088ad72))
@solaris007
Copy link
Member

🎉 This PR is included in version 1.15.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants