cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6377] Keeping CT for empty bodies by default, optionally blocking it
Date Thu, 30 Apr 2015 10:10:26 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 013fd951b -> f2b0390b1


[CXF-6377] Keeping CT for empty bodies by default, optionally blocking it


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f2b0390b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f2b0390b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f2b0390b

Branch: refs/heads/master
Commit: f2b0390b122691231f51660cb5178b45a6953586
Parents: 013fd95
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Apr 30 11:10:11 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Apr 30 11:10:11 2015 +0100

----------------------------------------------------------------------
 .../apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f2b0390b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
index 505f84a..73e8d96 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
@@ -174,8 +174,6 @@ public class JAXRSOutInterceptor extends AbstractOutDatabindingInterceptor
{
             if (initialResponseContentType != null && !responseHeaders.containsKey(HttpHeaders.CONTENT_TYPE))
{
                 responseHeaders.putSingle(HttpHeaders.CONTENT_TYPE, initialResponseContentType);
             }
-        } else {
-            message.remove(Message.CONTENT_TYPE);
         }
         
         message.put(Message.PROTOCOL_HEADERS, responseHeaders);
@@ -196,8 +194,10 @@ public class JAXRSOutInterceptor extends AbstractOutDatabindingInterceptor
{
         if (entity == null) {
             if (!headResponse) {
                 responseHeaders.putSingle(HttpHeaders.CONTENT_LENGTH, "0");
-                responseHeaders.remove(HttpHeaders.CONTENT_TYPE);
-                message.remove(Message.CONTENT_TYPE);
+                if (MessageUtils.getContextualBoolean(message, "remove.content.type.for.empty.response",
false)) {
+                    responseHeaders.remove(HttpHeaders.CONTENT_TYPE);
+                    message.remove(Message.CONTENT_TYPE);
+                }
             }
             HttpUtils.convertHeaderValuesToString(responseHeaders, true);
             return;


Mime
View raw message