hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1516) URL-encoded form paramters - missing '=' for null-values
Date Tue, 17 Jun 2014 11:28:02 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14033671#comment-14033671

Oleg Kalnichevski commented on HTTPCLIENT-1516:

bq. Ok, but I think it would be a more stable implementation to add the '=' even if there
is no value present for the parameter

Allow me to disagree.

bq. Just for interest: what was the reason this null-check had been added for version 4.2?

If my memory serves me well it was done to be able to distinguish empty and null parameter


> URL-encoded form paramters - missing '=' for null-values
> --------------------------------------------------------
>                 Key: HTTPCLIENT-1516
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1516
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2.6, 4.3.2, 4.3.3, 4.3.4, 4.3.5
>            Reporter: Stanley Hillner
> If you pass {{null}} as the value for a post parameter and use URL-encoded form parameters
the Method {{org.apache.http.client.utils.URLEncodedUtils#format}} omits the separator character
({{=}}) for this parameter which results in urls like the following.
> {{http://example.org/test?a=1&b&c=2}}
> In this case parameter {{b}} was assigned {{null}} as its value.
> It is not totally clear if the key/value separator character must be present even if
the value is omitted (RFC 1738 doesn't handle this case) but this implementation leads to
incompatibilities to other systems.
> I encountered this issue with httpclient 4.2.1 on the one side and undertow web server
shipped with Wildfly 8.0.0.Final.
> I also opened an issue for undertow just to clarify the correct handling of null-values
for url-parameters: [https://issues.jboss.org/browse/UNDERTOW-258]

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message