-
Notifications
You must be signed in to change notification settings - Fork 836
Open
Description
When query string parameter value an ampersand inside a double-quote, leading the string after & being misinterpreted as the next parameter.
Reproducer:
package com.hirle;
import java.net.MalformedURLException;
import java.net.URL;
import com.github.kevinsawicki.http.HttpRequest;
public class Reproducer
{
public static void main( String[] args )
{
URL webHookUrl = getWebHookURL();
HttpRequest httpRequest = HttpRequest
.get(webHookUrl.toExternalForm(), true, "movie", "Named \"Bonnie&Clyde\"")
.acceptJson();
int returnedCode = httpRequest.code();
System.out.println("Returned code: " + returnedCode);
}
private static URL getWebHookURL() {
try {
return new URL("https://webhook.site/PUT_YOUR_WEBHOOK_HERE");
} catch (MalformedURLException exception) {
throw new IllegalStateException(exception);
}
}
}Expected: GET https://webhook.site/c0c8cb19-e679-4036-94ac-5fdaea3463fa?movie=Named%20%22Bonnie%26Clyde%22
Obtained: GET https://webhook.site/c0c8cb19-e679-4036-94ac-5fdaea3463fa?movie=Named%20%22Bonnie&Clyde%22
Metadata
Metadata
Assignees
Labels
No labels