Author: alessio.soldano(a)jboss.com
Date: 2009-09-16 13:10:26 -0400 (Wed, 16 Sep 2009)
New Revision: 10701
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java
Log:
[JBWS-2763] Using precompile pattern to clean headers
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java 2009-09-16
17:09:04 UTC (rev 10700)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java 2009-09-16
17:10:26 UTC (rev 10701)
@@ -31,6 +31,7 @@
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
+import java.util.regex.Pattern;
import javax.net.ssl.SSLEngine;
import javax.xml.rpc.Stub;
@@ -84,6 +85,8 @@
//We always use chunked transfer encoding unless explicitly disabled by user
private Integer chunkSize = new Integer(DEFAULT_CHUNK_SIZE);
+ private static final Pattern headerCleanerPattern =
Pattern.compile("[\r\n\f]");
+
/**
* Construct a Netty client with the provided marshaller/unmarshaller.
*
@@ -347,7 +350,7 @@
for (String key : headers.keySet())
{
String header = (String)headers.get(key);
- message.addHeader(key, header.replaceAll("[\r\n\f]", " "));
+ message.addHeader(key, headerCleanerPattern.matcher(header).replaceAll("
"));
}
}
Show replies by date