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

Add Url Decoding #60

Open
crommcruach opened this issue Sep 23, 2021 · 1 comment
Open

Add Url Decoding #60

crommcruach opened this issue Sep 23, 2021 · 1 comment

Comments

@crommcruach
Copy link

For Example u send following URL to RESTPS:
http://localhost:8080/test/route?text=das ist ein text

U will recieve this Parameter: text=das%20ist%20ein%20text"
Now we could use this to decode the URL Properly:

$urlTodDecode="http://localhost:8080/?text=das%20ist%20ein%20text"
$decodedURL = [System.Web.HttpUtility]::UrlDecode($urlTodDecode)
echo $decodedURL

Return
http://localhost:8080/test/route?text=das ist ein text

So u could achive this in restps by simply replacing this line:
$RawRequestURL = $script:Request.RawUrl
$RawRequestURL = [System.Web.HttpUtility]::UrlDecode($script:Request.RawUrl)

@jpsider
Copy link
Owner

jpsider commented Sep 25, 2021

Sweet! Do you want to add a pull request?

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

2 participants