-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
src/experimentation/handler.js
Outdated
url: finalUrl, | ||
}; | ||
|
||
const data = await rumAPIClient.getExperimentationData(params); | ||
let data = await rumAPIClient.getExperimentationData(params); | ||
if (data.length === 0 && !finalUrl.toLowerCase().startsWith('www')) { |
There was a problem hiding this comment.
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')`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorporated this.
src/experimentation/handler.js
Outdated
const data = await rumAPIClient.getExperimentationData(params); | ||
let data = await rumAPIClient.getExperimentationData(params); | ||
if (data.length === 0 && !finalUrl.toLowerCase().startsWith('www')) { | ||
finalUrl = 'www.'.concat(finalUrl); |
There was a problem hiding this comment.
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}`;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorporated this.
This PR will trigger a patch release when merged. |
## [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))
## [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))
🎉 This PR is included in version 1.15.8 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Please ensure your pull request adheres to the following guidelines:
Related Issues
Thanks for contributing!