Skip to content

Commit

Permalink
fix location
Browse files Browse the repository at this point in the history
  • Loading branch information
iamlinhui committed Apr 14, 2022
1 parent fc5b416 commit b8fb89c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ protected void channelRead0(ChannelHandlerContext ctx, FullHttpResponse response
HttpResponseStatus status = response.status();
if (REDIRECT_STATUS.contains(status.code())) {
String location = String.valueOf(response.headers().get(HttpHeaderNames.LOCATION));
int index = location.indexOf("/", 8);
location = HttpScheme.HTTP + "://" + clientConfig.getConfig().get(0).getDomain() + location.substring(index);
response.headers().set(HttpHeaderNames.LOCATION, location);
if (location.startsWith(HttpScheme.HTTP.toString())) {
int index = location.indexOf("/", 8);
location = HttpScheme.HTTP + "://" + clientConfig.getConfig().get(0).getDomain() + location.substring(index);
response.headers().set(HttpHeaderNames.LOCATION, location);
}
}
response.headers().set(HttpHeaderNames.SERVER, Constants.RPT);
List<Object> encode = new ArrayList<>();
Expand Down

0 comments on commit b8fb89c

Please sign in to comment.