Skip to content

Commit

Permalink
fix: properly url decode query parameters in QueryStringDecoder
Browse files Browse the repository at this point in the history
  • Loading branch information
uprightech committed Aug 16, 2021
1 parent ac3c5e9 commit 20b855e
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -6,6 +6,8 @@

package org.gluu.oxauth.util;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -33,7 +35,11 @@ public static Map<String, String> decode(String queryString) {
String[] nameValue = param.split("=");
String name = nameValue.length > 0 ? nameValue[0] : "";
String value = nameValue.length > 1 ? nameValue[1] : "";
map.put(name, value);
try {
map.put(name, URLDecoder.decode(value,"UTF-8"));
}catch(UnsupportedEncodingException e) {
map.put(name,value);
}
}
}

Expand Down

0 comments on commit 20b855e

Please sign in to comment.