You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Siqi Li (Jira)" <ji...@apache.org> on 2021/06/13 05:23:00 UTC
[jira] [Created] (HTTPCORE-681) Inconsistent behavior between
WWWFormCodec and URLEncodedUtils for null input
Siqi Li created HTTPCORE-681:
--------------------------------
Summary: Inconsistent behavior between WWWFormCodec and URLEncodedUtils for null input
Key: HTTPCORE-681
URL: https://issues.apache.org/jira/browse/HTTPCORE-681
Project: HttpComponents HttpCore
Issue Type: Bug
Components: HttpCore
Affects Versions: 5.1
Reporter: Siqi Li
Simple code example:
{code:java}
public static void main(String[] args) {
System.out.println(URLEncodedUtils.parse((String) null, StandardCharsets.UTF_8)); // []
System.out.println(WWWFormCodec.parse((String) null, StandardCharsets.UTF_8)); // null
}
{code}
Basically when the input String is null, URLEncodedUtils.parse returns an empty list and WWWFormCodec.parse returns null. It's by no means a big deal, but it did catch me off guard, because I expected WWWFormCodec to be a drop-in replacement.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org