Skip to content

Commit

Permalink
Autoserve index.html from directories
Browse files Browse the repository at this point in the history
  • Loading branch information
fireduck64 committed Feb 12, 2020
1 parent 2b6378c commit 321abeb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ChannelGlobals.java
Expand Up @@ -3,7 +3,7 @@

public class ChannelGlobals
{
public static final String VERSION = "dev.2020.02.12.00";
public static final String VERSION = "dev.2020.02.12.02";

public static final String NODE_ADDRESS_STRING="node";
public static final String CHANNEL_ADDRESS_STRING="chan";
Expand Down
9 changes: 4 additions & 5 deletions src/WebServer.java
Expand Up @@ -94,11 +94,6 @@ public void handle(HttpExchange t) throws IOException {
handleRoot(t);
return;
}
else
{
tokens.add("index.html");
}

}
if (cid != null)
{
Expand Down Expand Up @@ -288,6 +283,10 @@ private void handleChannelGet(ChannelID cid, List<String> tokens, HttpExchange t
{
path += "/" + tokens.get(i);
}
if (t.getRequestURI().getPath().endsWith("/"))
{
path+= "/index.html";
}

ByteString content_id = ChanDataUtils.getData(ctx, path);

Expand Down

0 comments on commit 321abeb

Please sign in to comment.