From c16461ed56f2a62a1ed6f7f06053cf72988ce006 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Wed, 11 May 2022 20:08:48 +0000 Subject: [PATCH] Upload form included, currently hangs server without a response --- notes.md | 3 ++ out/DIRECTORY_LISTING | 13 ++++---- out/articles/DIRECTORY_LISTING | 10 +++--- out/articles/test articles/DIRECTORY_LISTING | 12 +++---- out/codeBackground | 4 +-- out/uploadform.html | 34 ++++++++++++++++++++ sigServer.java | 8 +++-- sitefiles/uploadform.html | 5 +++ 8 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 notes.md create mode 100644 out/uploadform.html create mode 100644 sitefiles/uploadform.html diff --git a/notes.md b/notes.md new file mode 100644 index 0000000..8ad56f4 --- /dev/null +++ b/notes.md @@ -0,0 +1,3 @@ +User Database +============= +Storage using flat files. User information stores the password hash. Store a session token too. Avatar uploader. \ No newline at end of file diff --git a/out/DIRECTORY_LISTING b/out/DIRECTORY_LISTING index 52c09e3..ed2922d 100644 --- a/out/DIRECTORY_LISTING +++ b/out/DIRECTORY_LISTING @@ -18,12 +18,13 @@
-

Directory Listing for /

📁articles 2022-05-06T18:25:24.961387Z gitpod 190
-
🗎codeBackground 2022-05-06T18:25:24.901387Z gitpod 2635
-
🗎otherpage.html 2022-05-06T18:25:24.941387Z gitpod 8892
-
🗎reset.css 2022-05-06T18:25:24.909387Z gitpod 1093
-
🗎sig.css 2022-05-06T18:25:24.917387Z gitpod 4702
-
🗎testfile.html 2022-05-06T18:25:24.941387Z gitpod 829
+

Directory Listing for /

📁articles 2022-05-11T20:04:09.890362Z gitpod 190
+
🗎codeBackground 2022-05-11T20:04:09.826362Z gitpod 2635
+
🗎otherpage.html 2022-05-11T20:04:09.866362Z gitpod 8892
+
🗎reset.css 2022-05-11T20:04:09.834362Z gitpod 1093
+
🗎sig.css 2022-05-11T20:04:09.842362Z gitpod 4702
+
🗎testfile.html 2022-05-11T20:04:09.866362Z gitpod 829
+
🗎uploadform.html 2022-05-11T20:04:09.866362Z gitpod 871
diff --git a/out/articles/DIRECTORY_LISTING b/out/articles/DIRECTORY_LISTING index 02641bd..ad837c7 100644 --- a/out/articles/DIRECTORY_LISTING +++ b/out/articles/DIRECTORY_LISTING @@ -18,11 +18,11 @@
-

Directory Listing for /articles/

🗎curabitur vel tempus ex.article 2022-05-06T18:25:24.885387Z gitpod 579
-
🗎sigplace1.article 2022-05-06T18:25:24.889387Z gitpod 3807
-
📁test articles 2022-05-06T18:25:24.953387Z gitpod 147
-
🗎curabitur vel tempus ex.article.html 2022-05-06T18:25:24.945387Z gitpod 1296
-
🗎sigplace1.article.html 2022-05-06T18:25:24.949387Z gitpod 4524
+

Directory Listing for /articles/

🗎curabitur vel tempus ex.article 2022-05-11T20:04:09.810362Z gitpod 579
+
🗎sigplace1.article 2022-05-11T20:04:09.814362Z gitpod 3807
+
📁test articles 2022-05-11T20:04:09.882362Z gitpod 147
+
🗎curabitur vel tempus ex.article.html 2022-05-11T20:04:09.874362Z gitpod 1296
+
🗎sigplace1.article.html 2022-05-11T20:04:09.878362Z gitpod 4524
diff --git a/out/articles/test articles/DIRECTORY_LISTING b/out/articles/test articles/DIRECTORY_LISTING index ff3f618..1f0e069 100644 --- a/out/articles/test articles/DIRECTORY_LISTING +++ b/out/articles/test articles/DIRECTORY_LISTING @@ -18,12 +18,12 @@
-

Directory Listing for /articles/test articles/

🗎test1.article 2022-05-06T18:25:24.889387Z gitpod 1068
-
🗎test2.article 2022-05-06T18:25:24.893387Z gitpod 764
-
🗎test3.article 2022-05-06T18:25:24.893387Z gitpod 977
-
🗎test1.article.html 2022-05-06T18:25:24.949387Z gitpod 1785
-
🗎test2.article.html 2022-05-06T18:25:24.953387Z gitpod 1481
-
🗎test3.article.html 2022-05-06T18:25:24.953387Z gitpod 1694
+

Directory Listing for /articles/test articles/

🗎test1.article 2022-05-11T20:04:09.818362Z gitpod 1068
+
🗎test2.article 2022-05-11T20:04:09.818362Z gitpod 764
+
🗎test3.article 2022-05-11T20:04:09.818362Z gitpod 977
+
🗎test1.article.html 2022-05-11T20:04:09.878362Z gitpod 1785
+
🗎test2.article.html 2022-05-11T20:04:09.882362Z gitpod 1481
+
🗎test3.article.html 2022-05-11T20:04:09.882362Z gitpod 1694
diff --git a/out/codeBackground b/out/codeBackground index 37dbdbe..4d031bb 100644 --- a/out/codeBackground +++ b/out/codeBackground @@ -9,8 +9,8 @@ ZonedDateTime modifiedDate = null; requestLine=in.readLine(); //Read the first line, this should be our request. if (requestLine!=null) { - while (!(line=in.readLine()).isBlank()) { - //System.out.println(requestLine); + while ((line=in.readLine())!=null) { + System.out.println(line); if (line.contains("If-Modified-Since: ")) { String modifiedSince=line.replace("If-Modified-Since: ",""); modifiedDate = ZonedDateTime.parse(modifiedSince,DateTimeFormatter.RFC_1123_DATE_TIME); diff --git a/out/uploadform.html b/out/uploadform.html new file mode 100644 index 0000000..3adeca7 --- /dev/null +++ b/out/uploadform.html @@ -0,0 +1,34 @@ + + + + + + + + + +
+ +SigPlace +
+ + +
+ +
+
+
+ + + diff --git a/sigServer.java b/sigServer.java index f5381af..a27f970 100644 --- a/sigServer.java +++ b/sigServer.java @@ -17,7 +17,6 @@ import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.HashMap; -import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; public class sigServer { @@ -34,8 +33,8 @@ public class sigServer { ZonedDateTime modifiedDate = null; requestLine=in.readLine(); //Read the first line, this should be our request. if (requestLine!=null) { - while (!(line=in.readLine()).isBlank()) { - //System.out.println(requestLine); + while ((line=in.readLine())!=null) { + System.out.println(line); if (line.contains("If-Modified-Since: ")) { String modifiedSince=line.replace("If-Modified-Since: ",""); modifiedDate = ZonedDateTime.parse(modifiedSince,DateTimeFormatter.RFC_1123_DATE_TIME); @@ -79,6 +78,9 @@ public class sigServer { } } } + } else + if (splitter[0].equals("POST")) { //This is a POST request. + CreateRequest(client,"501","Not Implemented","testfile.html"); } else { CreateRequest(client,"501","Not Implemented","testfile.html"); } diff --git a/sitefiles/uploadform.html b/sitefiles/uploadform.html new file mode 100644 index 0000000..7c4de92 --- /dev/null +++ b/sitefiles/uploadform.html @@ -0,0 +1,5 @@ +$SITENAME +
+ + +
\ No newline at end of file