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 issue with urlencoded user handles #1221

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

ThomasKranitsas
Copy link
Collaborator

Fixes #1220

Note that I had to update the start command to webpack-dev-server --history-api-fallback --host 0.0.0.0 --dev --tc --inline --progress --port 3000 --public local.topcoder-dev.com:3000 in order to run the app locally on MacOS..

@birdofpreyru
Copy link
Collaborator

There is an issue:

  1. I have deployed locally and run at local.topcoder.com;
  2. I go to http://local.topcoder.com/members/[[iwi]] - it loads the profile, but replaces URL by http://local.topcoder.com/members/%255B%255Biwi%255D%255D/, which is an incorrect URL encoding for [[iwi]] (the correct one is %5B%5Biwi%5D%5D). If I know remove the trailing / and press reload the page, it goes to 404.
  3. Similarly http://local.topcoder.com/members/John%20Dethridge, when accessed, replaces URL by http://local.topcoder.com/members/John%2520Dethridge/, which goes to 404, if I remove the trailing /.

This should be polished to ensure that current URL is encoded/decoded correctly.

@ThomasKranitsas
Copy link
Collaborator Author

@birdofpreyru this is a double encoding issue.. I managed to recursively decode the routeParam and get the app working even if the URL is http://local.topcoder-dev.com:3000/members/%252525255B%252525255Biwi%252525255D%252525255D/ ([[iwi]])

I'm trying to prevent the double encoding to avoid such ugly URLs..

I'll push a commit shortly.

@birdofpreyru
Copy link
Collaborator

@ThomasKranitsas Cool!
Actually, I don't see why we need to replace the URL in such case at all? If we manage to load the profile, when [[iwi]] is inside the URL, why do we need to replace it with URL-encoded one? Also, when there is trailing / no such replacement take place.

@ThomasKranitsas
Copy link
Collaborator Author

@birdofpreyru that's what I'm trying to do actually :)

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