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

Refresh error due to double encoding in verticalUrl #836

Merged
merged 3 commits into from
Jun 17, 2021

Conversation

yen-tt
Copy link
Contributor

@yen-tt yen-tt commented Jun 16, 2021

  • URLSearchParams set() encoded verticalUrl even though it's already encoded, extracted from window's URL pathname. Changed to appending to the param string

J=SLAP-1376
TEST=manual

Launched multilang site with iframe data-path directed to a page with spaces in its names. Confirmed refresh and back/forward nav works accordingly.

- URLSearchParams set() encoded verticalUrl even though it's already encoded since it's extracted from window's URL pathname. updated to append to the param string
- replace() only update the first instance unless a global modifier is used (e.g. this would cause refresh issue on mulilang site for verticalUrl as 'es/help_articles'. updated to replaceAll

J=SLAP-1376
TEST=manual

Launched multilang site with iframe data-path directed to a page with spaces in its names. Confirmed refresh and back/forward nav works accordingly.
@coveralls
Copy link

coveralls commented Jun 16, 2021

Coverage Status

Coverage increased (+0.0007%) to 5.562% when pulling e047981 on dev/double-encoding-verticalURL into 18377da on develop.

layouts/html.hbs Outdated Show resolved Hide resolved
@@ -15,9 +15,6 @@ export function generateIFrame(domain, queryParam, urlParam) {
var paramString = window.location.search;
paramString = paramString.substr(1, paramString.length);

// Decode ASCII forward slash to avod repeat encodings on page refreshes
paramString = paramString.replace("%2F", "/");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we able to get rid of this because window.location.search is already encoded?

Copy link
Contributor Author

@yen-tt yen-tt Jun 16, 2021

Choose a reason for hiding this comment

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

yeah, it's already encoded pulling from browser. I believe this was added before to avoid the same double encoding problem with multilang when the verticalUrl is something like 'es/help_articles' but this change should fix this!

layouts/html.hbs Outdated Show resolved Hide resolved
layouts/html.hbs Outdated Show resolved Hide resolved
@yen-tt yen-tt force-pushed the dev/double-encoding-verticalURL branch from 1353bb7 to e047981 Compare June 16, 2021 14:46
@yen-tt yen-tt requested review from oshi97 and tmeyer2115 June 16, 2021 17:13
Copy link
Contributor

@oshi97 oshi97 left a comment

Choose a reason for hiding this comment

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

lgtm!

@yen-tt yen-tt merged commit 72ba4c7 into develop Jun 17, 2021
@yen-tt yen-tt deleted the dev/double-encoding-verticalURL branch June 17, 2021 16:00
@cea2aj cea2aj mentioned this pull request Jun 23, 2021
cea2aj added a commit that referenced this pull request Jun 23, 2021
## Version 1.22.0
### Changes
- Code coverage reports are now generated automatically for the Theme. (#759)
- A number of dependencies were updated in accordance with Dependabot's suggestions. (#780)
- The build time in `Development` mode was reduced significantly. (#782, #829) Build times in 
`Production` mode were also decreased. (#783, #825)
- Two new cards supporting videos were added: `product-prominentvideo` and `multilang-product-prominentvideo`. These cards
work with either YouTube or Vimeo content. (#794)
- The process for formatting hours was made more efficient, resulting in faster renders for cards with hours. (#784)
- Any SDK branch can now be specified in the `global_config.sdkVersion` attribute. (#791)
- Unused CSS was removed from the Theme. (#793, #798)
- To reduce flashing related to the SDK Component lifecycle, placeholder skeletons were added for the `SearchBar` and
`Navigation` components. (#797)
- Additional acceptance tests were added for the `VerticalFullPageMap` and Percy snapshots are now generated for all
cards. (#830, #820)
- Multi-language tests were added for the Theme. (#826)
- The `documentsearch-standard` card now supports rich text featured snippets. (#838)
- A new concept, `RuntimeConfig` was added. This allows configuration, computed at run-time, to be injected into the
Theme and SDK. This new concept enables JWT integrations as well. (#843)
### Bug Fixes
- A number of changes were made to make the Theme's visual regression tests more reliable. (#764, #765, #766, #778)
- Corrected how the CTA URLs for the `menuitem-standard` and `multilang-menuitem-standard` cards are computed. (#787)
- The Google Streetview person icon is now visible when using the `VerticalFullPageMap` layout. (#801)
- The size of the cluster and result pins are now configurable. (#807)
- A double encoding error for `verticalUrl` was fixed. (#836)
- The `Opens At` open status message is now properly translated in all languages. (#834)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants