Skip to content

Commit

Permalink
Merge pull request #1704 from akto-api-security/hotfix/fix_url_encode…
Browse files Browse the repository at this point in the history
…d_req

fix non-string cases for url encoded
  • Loading branch information
notshivansh authored Nov 9, 2024
2 parents 08aa036 + 0659876 commit c2e0ff4
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,8 @@ public static String jsonToFormUrlEncoded(String requestPayload) {
for (String key : jsonObject.keySet()) {
// Encode the key and value, and append them to the string builder
try {
formUrlEncoded.append(encode(key))
.append("=")
.append(encode(jsonObject.getString(key)))
.append("&");
String tmp = encode(key) + "=" + encode(String.valueOf(jsonObject.get(key))) + "&";
formUrlEncoded.append(tmp);
} catch (Exception e) {
e.printStackTrace();
}
Expand Down

0 comments on commit c2e0ff4

Please sign in to comment.