Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Changed content-type, allows custom port now
Browse files Browse the repository at this point in the history
  • Loading branch information
KiralyCraft committed May 11, 2020
1 parent 3668d83 commit 9cdb30b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ private void writeUploadOK() throws IOException
private void writeHeaders(File toSend) throws IOException
{
os.write(new String("HTTP/1.1 200 OK\r\n").getBytes());
os.write(new String("Content-Type: image\r\n").getBytes());
os.write(new String("Content-Type: application/gzip\r\n").getBytes());
os.write(new String("Connection: close\r\n").getBytes());
os.write(new String("Content-Disposition: inline; filename=\""+toSend.getName()+".schematic\"\r\n").getBytes());
os.write(new String("Content-Length: "+toSend.length()+"\r\n").getBytes());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ public static void main(String[] args)
{
theFolder = args[0];
}
HostingServer hs = new HostingServer(25532,new File(theFolder));

int port = 25532;
if (args.length >= 2)
{
port = Integer.parseInt(args[1]);
}

HostingServer hs = new HostingServer(port,new File(theFolder));
hs.start();
}

Expand Down

0 comments on commit 9cdb30b

Please sign in to comment.