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

encoding longUrl for admin-ajax.php breaks some urls #49

Open
adamcoulombe opened this issue Jan 16, 2025 · 1 comment
Open

encoding longUrl for admin-ajax.php breaks some urls #49

adamcoulombe opened this issue Jan 16, 2025 · 1 comment

Comments

@adamcoulombe
Copy link

Some long urls that contain spaces like %20 (or other encoded data) are not being saved to the DB faithfully.

take the following url for example:
https://mydocumentsharingplace.net/My%20Storage%20Folder/My%20Shared%20File.txt

gets stored in the shlink database as:
https://mydocumentsharingplace.net/MyStorageFolder/MySharedFile.txt

Which results in being redirected to a 404, because it isnt the same URL.

I suspect the issue is that the longUrl is being encoded and passed as a URI argument through admin-ajax.php as opposed to being sent in the request body as JSON. When I test the same URL using the Shlink web app, the URL is saved in the DB correctly. The shlink webapp accesses the shlink rest API directly.

@adamcoulombe
Copy link
Author

I should note that I tried decoding the url before encoding it, which sort of worked for some URLs, but created other issues for other URLs

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

No branches or pull requests

1 participant