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

Commit 9a47398

Browse files
committed
Fixed #8 case is native to sun and can't be changed
1 parent fab618d commit 9a47398

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/ktt/lib/httpserver/SimpleHttpServer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
/**
1313
* <i>This class is a simplified implementation of {@link HttpServer}.</i><br>
14-
* At least one {@link HttpHandler} must be created in order to process requests. When handling requests the server will use the most specific context. If no handler can be found it is rejected with a 404 response.
14+
* At least one {@link HttpHandler} must be created in order to process requests. When handling requests the server will use the most specific context. If no handler can be found it is rejected with a 404 response. <br>
15+
* <b>Contexts are case-sensitive.</b>
1516
*
1617
* @see HttpServer
1718
* @see HttpHandler

src/ktt/lib/httpserver/SimpleHttpServerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public final String toString(){
273273
}
274274

275275
private static String getContext(final String path){
276-
final String linSlash = path.toLowerCase().replace("\\","/");
276+
final String linSlash = path.replace("\\","/");
277277
if(linSlash.equalsIgnoreCase("/")) return "/";
278278
final String seSlash = (!linSlash.startsWith("/") ? "/" : "") + linSlash + (!linSlash.endsWith("/") ? "/" : "");
279279
return seSlash.substring(0,seSlash.length()-1);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public final byte[] getBytes(final String path){
212212
//
213213

214214
private static String getContext(final String path){
215-
final String linSlash = path.toLowerCase().replace("\\","/");
215+
final String linSlash = path.replace("\\","/");
216216
if(linSlash.equalsIgnoreCase("/")) return "/";
217217
final String seSlash = (!linSlash.startsWith("/") ? "/" : "") + linSlash + (!linSlash.endsWith("/") ? "/" : "");
218218
return seSlash.substring(0,seSlash.length()-1);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
/**
1111
* A request handler that processes files using the {@link FileHandlerAdapter}. <br>
12-
* The <code>context</code> parameter determines if the relative context of the file within the handler before the name. <br>
12+
* The <code>context</code> parameter determines if the relative context of the file within the handler before the name. <i>case-sensitive</i> <br>
1313
* The <code>fileName</code> parameter overrides the {@link FileHandlerAdapter#getName(File)} and determines the name of the file after the context (if there is one). <br>
1414
* The <code>directoryName</code> parameter determines the directory's name. Add the files at the top level by keeping this field empty. <br>
1515
* The <code>preload</code> parameter determines if the handler should read the bytes when they are added or read the file at the exchange. <br>
@@ -683,7 +683,7 @@ public void handle(final SimpleHttpExchange exchange, final File source, final b
683683
//
684684

685685
private static String getContext(final String path){
686-
final String linSlash = path.toLowerCase().replace("\\","/");
686+
final String linSlash = path.replace("\\","/");
687687
if(linSlash.equalsIgnoreCase("/")) return "/";
688688
final String seSlash = (!linSlash.startsWith("/") ? "/" : "") + linSlash + (!linSlash.endsWith("/") ? "/" : "");
689689
return seSlash.substring(0,seSlash.length()-1);

0 commit comments

Comments
 (0)