Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
http1 proxy add a additional Host header
param name is not decode while displaying
  • Loading branch information
hsiafan committed Apr 13, 2019
1 parent 1335129 commit 5510642
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<dependency>
<groupId>net.dongliu</groupId>
<artifactId>commons</artifactId>
<version>7.4.0</version>
<version>7.6.1</version>
</dependency>
<!-- netty -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
int port = url.getPort();
String authority = url.getAuthority();
request.setUri(url.getFile());
request.headers().add("Host", host);
request.headers().set("Host", host);
stripRequest(request);

if (port == -1) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/dongliu/proxy/utils/NameValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static List<? extends NameValue> parseUrlEncodedParams(String text, Chars
String name = segment.substring(0, idx).trim();
String value = segment.substring(idx + 1).trim();
value = URLDecoder.decode(value, charset);
name = URLDecoder.decode(name, charset);
params.add(new Parameter(name, value));
} else {
String value = URLDecoder.decode(segment, charset);
Expand Down

0 comments on commit 5510642

Please sign in to comment.