Author: jvermillard
Date: Wed Aug 26 12:48:07 2009
New Revision: 807985
URL: http://svn.apache.org/viewvc?rev=807985&view=rev
Log:
fixing ASYNCWEB-34 by replacing '|' by the escape sequence before parsing with
the URI class
Modified:
mina/asyncweb/trunk/common/src/main/java/org/apache/asyncweb/common/codec/HttpRequestLineDecodingState.java
Modified:
mina/asyncweb/trunk/common/src/main/java/org/apache/asyncweb/common/codec/HttpRequestLineDecodingState.java
URL:
http://svn.apache.org/viewvc/mina/asyncweb/trunk/common/src/main/java/org/apache/asyncweb/common/codec/HttpRequestLineDecodingState.java?rev=807985&r1=807984&r2=807985&view=diff
==============================================================================
---
mina/asyncweb/trunk/common/src/main/java/org/apache/asyncweb/common/codec/HttpRequestLineDecodingState.java
(original)
+++
mina/asyncweb/trunk/common/src/main/java/org/apache/asyncweb/common/codec/HttpRequestLineDecodingState.java
Wed Aug 26 12:48:07 2009
@@ -19,7 +19,7 @@
*/
package org.apache.asyncweb.common.codec;
-import java.net.URL;
+import java.net.URI;
import java.nio.charset.CharsetDecoder;
import org.apache.asyncweb.common.HttpMethod;
@@ -87,8 +87,11 @@
@Override
protected DecodingState finishDecode(IoBuffer product,
ProtocolDecoderOutput out) throws Exception {
- out.write(new URL(product.getString(defaultDecoder)));
- return AFTER_READ_REQUEST_URI;
+ String uri = product.getString(defaultDecoder);
+ // replacing all the | by %7C because URI class doesn't support it
+ uri = uri.replace("|","%7C");
+ out.write(new URI(uri));
+ return AFTER_READ_REQUEST_URI;
}
};