Heyho, as part of the webapp I build with prologue I also have endpoints that perform searches on my db via path parameters in the URL.
As such, I want the path parameter in the URL to be URL-decoded because I'm not going to have anything with %20 stored in my database. However, when using prologue normally it appears to not decode the URL path parameters, as observed with this minimal setup:
When calling this endpoint with the URL {{host}}/test/Walumba bla it will put Walumba%20bla in searchText, which is not what I would want. Luckily this is a pretty easy fix, as std/uri provides a decodeUrl proc that can be used like this to fix it:
However, I think it makes sense to possibly have that be the default behaviour of prologue. Would this be alright? If so, I'd throw in a small PR in which I would add a call to decodeUrl in front of getPathParamsOption, getPathParams, getQueryParamsOption and getQueryParams.
Heyho, as part of the webapp I build with prologue I also have endpoints that perform searches on my db via path parameters in the URL.
As such, I want the path parameter in the URL to be URL-decoded because I'm not going to have anything with %20 stored in my database. However, when using prologue normally it appears to not decode the URL path parameters, as observed with this minimal setup:
When calling this endpoint with the URL
{{host}}/test/Walumba bla
it will putWalumba%20bla
insearchText
, which is not what I would want. Luckily this is a pretty easy fix, asstd/uri
provides adecodeUrl
proc that can be used like this to fix it:ctx.getPathParamsOption(SEARCH_TEXT_PARAM).get().decodeUrl()
However, I think it makes sense to possibly have that be the default behaviour of prologue. Would this be alright? If so, I'd throw in a small PR in which I would add a call to decodeUrl in front of
getPathParamsOption
,getPathParams
,getQueryParamsOption
andgetQueryParams
.