diff --git a/Zutil.jar b/Zutil.jar index 7903216..3c116df 100755 Binary files a/Zutil.jar and b/Zutil.jar differ diff --git a/src/zutil/net/http/HttpHeaderParser.java b/src/zutil/net/http/HttpHeaderParser.java index b3e8309..7e58628 100755 --- a/src/zutil/net/http/HttpHeaderParser.java +++ b/src/zutil/net/http/HttpHeaderParser.java @@ -24,6 +24,8 @@ package zutil.net.http; +import zutil.parser.URLDecoder; + import java.io.BufferedReader; import java.io.IOException; import java.util.HashMap; @@ -49,7 +51,7 @@ public class HttpHeaderParser { private HashMap cookies; /** - * Parses the HTTP header information from the stream + * Parses the HTTP header information from a stream * * @param in is the stream * @throws IOException @@ -147,6 +149,7 @@ public class HttpHeaderParser { */ public static void parseURLParameters(String attributes, HashMap map){ String[] tmp; + attributes = URLDecoder.decode(attributes); // get the variables String[] data = andPattern.split( attributes ); for(String element : data){ diff --git a/src/zutil/parser/URLDecoder.java b/src/zutil/parser/URLDecoder.java new file mode 100755 index 0000000..412a00c --- /dev/null +++ b/src/zutil/parser/URLDecoder.java @@ -0,0 +1,36 @@ +package zutil.parser; + +/** + * This utility class will decode Strings encoded with % sign's to a normal String + * + * Created by Ziver on 2015-12-11. + */ +public class URLDecoder { + + public static String decode(String url){ + if(url == null) + return null; + StringBuilder out = new StringBuilder(); + for (int i=0; i