Skip to content

Commit

Permalink
HttpRequestHandler get real path, support request parameters in url. #10
Browse files Browse the repository at this point in the history
  • Loading branch information
hengyunabc committed Feb 14, 2019
1 parent dc668aa commit 1dd5c8e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import io.termd.core.util.Logging;

import java.io.InputStream;
import java.net.URI;
import java.net.URL;

/**
Expand All @@ -57,7 +58,8 @@ protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request)

HttpResponse response = new DefaultHttpResponse(request.getProtocolVersion(), HttpResponseStatus.INTERNAL_SERVER_ERROR);

String path = request.getUri();
String path = new URI(request.getUri()).getPath();

if ("/".equals(path)) {
path = "/index.html";
}
Expand Down

0 comments on commit 1dd5c8e

Please sign in to comment.