JBossWeb SVN: r2599 - branches/7.5.x/src/main/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2015-03-18 12:25:19 -0400 (Wed, 18 Mar 2015)
New Revision: 2599
Modified:
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java
Log:
BZ1190298: Allow setting content-type in a 204 response, submitted by Enrique Gonzalez Martinez.
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java 2015-03-13 13:53:54 UTC (rev 2598)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java 2015-03-18 16:25:19 UTC (rev 2599)
@@ -1710,7 +1710,9 @@
MimeHeaders headers = response.getMimeHeaders();
if (!entityBody) {
response.setContentLength(-1);
- } else {
+ }
+ // A SC_NO_CONTENT response may include entity headers
+ if (entityBody || response.getStatus() == 204){
String contentType = response.getContentType();
if (contentType != null) {
headers.setValue("Content-Type").setString(contentType);
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java 2015-03-13 13:53:54 UTC (rev 2598)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java 2015-03-18 16:25:19 UTC (rev 2599)
@@ -1189,7 +1189,9 @@
MimeHeaders headers = response.getMimeHeaders();
if (!entityBody) {
response.setContentLength(-1);
- } else {
+ }
+ // A SC_NO_CONTENT response may include entity headers
+ if (entityBody || response.getStatus() == 204){
String contentType = response.getContentType();
if (contentType != null) {
headers.setValue("Content-Type").setString(contentType);
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java 2015-03-13 13:53:54 UTC (rev 2598)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java 2015-03-18 16:25:19 UTC (rev 2599)
@@ -1550,7 +1550,9 @@
MimeHeaders headers = response.getMimeHeaders();
if (!entityBody) {
response.setContentLength(-1);
- } else {
+ }
+ // A SC_NO_CONTENT response may include entity headers
+ if (entityBody || response.getStatus() == 204){
String contentType = response.getContentType();
if (contentType != null) {
headers.setValue("Content-Type").setString(contentType);