Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Commit 4fc5bab

Browse files
committed
Fixed context issue
1 parent ac2405b commit 4fc5bab

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/ktt/lib/httpserver/handler/FileHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ public final void addDirectory(final String context, final File directory, final
641641

642642
@Override
643643
public final void handle(final SimpleHttpExchange exchange) throws IOException{
644-
final String rel = getContext(exchange.getContext().substring(exchange.getHttpContext().getPath().length()));
644+
final String rel = getContext(exchange.getURI().getPath().substring(exchange.getHttpContext().getPath().length()));
645645

646646
String match = "";
647647
for(final String key : files.keySet())

src/ktt/lib/httpserver/handler/RootHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public RootHandler(final HttpHandler rootHandler, final HttpHandler elseHandler)
2929
super(
3030
rootHandler,
3131
elseHandler,
32-
simpleHttpExchange -> simpleHttpExchange.getContext().equals("/")
32+
simpleHttpExchange -> simpleHttpExchange.getURI().getPath().equals("/")
3333
);
3434
}
3535

0 commit comments

Comments
 (0)