Author: richard.opalka(a)jboss.com
Date: 2010-03-30 09:45:27 -0400 (Tue, 30 Mar 2010)
New Revision: 11900
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java
Log:
[NETTY-237] rollback workaround
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java 2010-03-30
11:30:31 UTC (rev 11899)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java 2010-03-30
13:45:27 UTC (rev 11900)
@@ -128,8 +128,11 @@
this.status = HttpResponseStatus.valueOf(sc);
}
- @Override
- public final void setStatus(HttpResponseStatus sc)
+ /**
+ * Sets response status code.
+ * @param sc response status code
+ */
+ public final void setStatus(final HttpResponseStatus sc)
{
this.status = sc;
}
@@ -211,8 +214,44 @@
key = header.getName();
List<String> values = new LinkedList<String>();
values.add(header.getValue());
+ values = this.removeProhibitedCharacters(values);
this.setHeader(key, values);
}
}
+ // TODO:
https://jira.jboss.org/jira/browse/NETTY-237
+ /**
+ * Removes prohibited header value characters.
+ *
+ * @param values header values before optimization
+ * @return optimized header values
+ */
+ private List<String> removeProhibitedCharacters(final List<String>
values)
+ {
+ final List<String> retVal = new LinkedList<String>();
+ for (int i = 0; i < values.size(); i++)
+ {
+ retVal.add(i, this.removeProhibitedCharacters(values.get(i)));
+ }
+
+ return retVal;
+ }
+
+ // TODO:
https://jira.jboss.org/jira/browse/NETTY-237
+ /**
+ * Removes prohibited header value characters.
+ *
+ * @param value header value before optimization
+ * @return optimized header value
+ */
+ private String removeProhibitedCharacters(final String value)
+ {
+ String retVal = value;
+
+ retVal = retVal.replace('\r', ' ');
+ retVal = retVal.replace('\n', ' ');
+
+ return retVal;
+ }
+
}