Broken URL path encoding?


#1

I’ve setup a simple URL shortener service which accepts the URL to be shortened as a URL path parameter.
This works fine on my local machine for example creating a shortened URL for Facebook as:
http://urlshortener.local/new/https%3A%2F%2Ffacebook.com

However, when using Hyperdev the encoded URL in the path is not preserved.
Instead it results in a redirect where the URL in the path is missing one of the double slashes following the protocol (https):

GET https://wood-beetle.hyperdev.space/new/https%3A%2F%2Ffacebook.com
301 Location: /new/https:/facebook.com

Are there any workarounds or a fix for this planned?


#2

Maybe @Bouncey can help? I think this is the same issue that was reported in https://support.hyperdev.com/t/hyperdev-replaces-with-in-requests-to-my-app/506


#3

That looks like exactly the same issue!
However, the resolution in that case (looking at the linked example) was to move the URL to a query parameter.

This indicates that there is an issue with Hyperdev not preserving the URL encoded slashes in the request when doing a redirect. Instead it looks like it just decodes the URL and adds that as path in the redirect which will break since URLs are not safe to include in the path of an URL (see the example in OP).


#4

@zamzterz that was my resolution, moving to queries.

I think moving to queries ensures the integrity of your app across the multiple hosts it could be hosted on, so as to counter anything strange that can occur to your app.