From 00a07a79b218eb7c0898ba47397baa3e0c62fbae Mon Sep 17 00:00:00 2001 From: Redkale <8730487+redkale@users.noreply.github.com> Date: Mon, 9 Sep 2019 16:25:10 +0800 Subject: [PATCH] --- src/org/redkale/net/http/HttpRequest.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/org/redkale/net/http/HttpRequest.java b/src/org/redkale/net/http/HttpRequest.java index 2482bea8e..e99343e47 100644 --- a/src/org/redkale/net/http/HttpRequest.java +++ b/src/org/redkale/net/http/HttpRequest.java @@ -1300,16 +1300,11 @@ public class HttpRequest extends Request { * @return String */ public String getParametersToString(String prefix) { - final StringBuilder sb = new StringBuilder(); - getParameters().forEach((k, v) -> { - if (sb.length() > 0) sb.append('&'); - try { - sb.append(k).append('=').append(URLEncoder.encode(v, "UTF-8")); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - }); - return (sb.length() > 0 && prefix != null) ? (prefix + sb) : sb.toString(); + byte[] rbs = queryBytes; + if (rbs == null || rbs.length < 1) return ""; + Charset charset = this.context.getCharset(); + String str = charset == null ? new String(rbs, StandardCharsets.UTF_8) : new String(rbs, charset); + return (prefix == null) ? str : (prefix + str); } /**