You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2021/04/17 01:05:36 UTC
[cxf] branch master updated: [CXF-7996] Fix '@Encode' TCK test.
Fixed tests and added a check for empty parameter name
This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new 3b1ddd7 [CXF-7996] Fix '@Encode' TCK test. Fixed tests and added a check for empty parameter name
3b1ddd7 is described below
commit 3b1ddd7c5e7a450d0c768e40850e5a899a8720b3
Author: reta <dr...@gmail.com>
AuthorDate: Fri Apr 16 21:05:10 2021 -0400
[CXF-7996] Fix '@Encode' TCK test. Fixed tests and added a check for empty parameter name
---
.../jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
index 844a7a1..f82fcf4 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
@@ -1037,7 +1037,9 @@ public final class JAXRSUtils {
if (mt == null || mt.isCompatible(MediaType.APPLICATION_FORM_URLENCODED_TYPE)) {
InputStream entityStream = copyAndGetEntityStream(m);
String body = FormUtils.readBody(entityStream, enc);
- FormUtils.populateMapFromStringOrHttpRequest(params, m, body, enc, false);
+ // Do not decode unless the key is empty value, fe @FormParam("")
+ FormUtils.populateMapFromStringOrHttpRequest(params, m, body, enc,
+ StringUtils.isEmpty(key) ? decode : false);
} else {
if ("multipart".equalsIgnoreCase(mt.getType())
&& MediaType.MULTIPART_FORM_DATA_TYPE.isCompatible(mt)) {