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

Update locale by URLSearchParams in locale_controller.js #202

Merged

Conversation

unasuke
Copy link
Contributor

@unasuke unasuke commented May 15, 2024

How to reproduce

2024-05-15.12.04.12.mov
  1. Visit to https://rubykaigi.smarthr.co.jp/2024/schedules
  2. Click date tab e.g. 2024-05-15
  3. Change locale
  4. Reload page.

The URL https://rubykaigi.smarthr.co.jp/2024/schedules#2024-05-15?locale=Asia%2FKamchatka is invalid. (Sorry, I can't find its specification from URL Spec)

Fix

Use the URLSearchParams interface.

https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/set

2024-05-15.12.06.20.mov

Using concat to the tail of window.href may cause produce invalid
URL.
For safety, use the URLSearchParams interface.
Copy link
Member

@kinoppyd kinoppyd left a comment

Choose a reason for hiding this comment

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

@unasuke Great fix, Thanks a lot for your contributing!

@kinoppyd kinoppyd merged commit 9b6e85e into kufu:main May 16, 2024
2 checks passed
@unasuke
Copy link
Contributor Author

unasuke commented May 16, 2024

Thank you too!!

@unasuke unasuke deleted the build-url-object-and-use-searchparams-interface branch May 16, 2024 23:03
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.

2 participants