Skip to content

Commit

Permalink
fix: resolve forward request host (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie authored Sep 30, 2022
1 parent 493b74e commit 95abb7c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Proxyee is a JAVA written HTTP proxy server library that supports HTTP, HTTPS, W
<dependency>
<groupId>com.github.monkeywie</groupId>
<artifactId>proxyee</artifactId>
<version>1.6.8</version>
<version>1.6.9</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Proxyee 是一个 JAVA 编写的 HTTP 代理服务器类库,支持 HTTP、HTTP
<dependency>
<groupId>com.github.monkeywie</groupId>
<artifactId>proxyee</artifactId>
<version>1.6.8</version>
<version>1.6.9</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.github.monkeywie</groupId>
<artifactId>proxyee</artifactId>
<version>1.6.8</version>
<version>1.6.9</version>

<packaging>jar</packaging>

Expand Down Expand Up @@ -151,7 +151,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.6.9</version>
<extensions>true</extensions>
<configuration>
<serverId>releases</serverId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static RequestProto getRequestProto(HttpRequest httpRequest) {
return null;
}

requestProto.setHost(url.getHost());
requestProto.setHost(url.getHost().isEmpty() ? httpRequest.headers().get(HttpHeaderNames.HOST) : url.getHost());
requestProto.setPort(url.getPort() != -1 ? url.getPort() : url.getDefaultPort());
requestProto.setProxy(httpRequest.headers().contains(HttpHeaderNames.PROXY_CONNECTION));
return requestProto;
Expand Down

0 comments on commit 95abb7c

Please sign in to comment.