From 6fb0b80a2d02884afc0805900cdb0efaf632eef2 Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Tue, 13 Apr 2021 13:32:56 -0500 Subject: [PATCH 001/154] Update webapp.js --- webapp.js | 1 - 1 file changed, 1 deletion(-) diff --git a/webapp.js b/webapp.js index 584456b8..10081e28 100644 --- a/webapp.js +++ b/webapp.js @@ -754,4 +754,3 @@ Changes with nginx 0.7.9 12 Aug 2008 WSC.WebApplication = WebApplication })(); - From 4b8a35004e5b8b49ce6637749dba478da3c6a2e3 Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Tue, 13 Apr 2021 13:33:56 -0500 Subject: [PATCH 002/154] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 81854e39..75611aa8 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "short_name": "Web Server", "description": "A Web Server for Chrome, serves web pages from a local folder over the network, using HTTP. Runs offline.", "author": "Kyle Graehl", - "version": "0.5.0", + "version": "0.5.3", "manifest_version": 2, "offline_enabled": true, "minimum_chrome_version": "45", From 69c13302fd99722728d4785916a8aed20210ff1b Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Tue, 13 Apr 2021 13:34:36 -0500 Subject: [PATCH 003/154] Update handlers.js --- handlers.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/handlers.js b/handlers.js index 5f9ab5ae..7c333464 100644 --- a/handlers.js +++ b/handlers.js @@ -293,12 +293,15 @@ (this.request.headers['accept'] && this.request.headers['accept'].toLowerCase() == 'application/json') ) { this.renderDirectoryListingJSON(results) - } else if (this.request.arguments && this.request.arguments.static == '1' || + } else if (this.app.opts.optDir404 && this.app.opts.optRenderIndex) { + this.write("404 - File not found", 404) + this.finish() + } else if (this.request.arguments && this.request.arguments.static == '1' || this.request.arguments.static == 'true' || this.app.opts.optStatic ) { this.renderDirectoryListing(results) - } else { + } else { this.renderDirectoryListingTemplate(results) } } From e8e878ceecd9afe95317588dc39c087c52616fa9 Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Tue, 13 Apr 2021 13:35:18 -0500 Subject: [PATCH 004/154] Update options.js --- react-ui/js/options.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/react-ui/js/options.js b/react-ui/js/options.js index 98b26163..74dc213d 100644 --- a/react-ui/js/options.js +++ b/react-ui/js/options.js @@ -170,6 +170,12 @@ const options = { type: Boolean, default: true }, + optDir404: { + label: '404 instead of directory listing', + help: 'When no index.html is found, you will get a 404 error.', + type: Boolean, + default: false + }, optUpload: { label: 'Allow File upload', help: 'The files directory listing allows drag-and-drop to upload small files', From 21f5d6043ab5dad3b2d5dc5c31d838dcc28e1779 Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Tue, 13 Apr 2021 13:35:35 -0500 Subject: [PATCH 005/154] Update index.js --- react-ui/js/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/react-ui/js/index.js b/react-ui/js/index.js index 65776158..0951d369 100644 --- a/react-ui/js/index.js +++ b/react-ui/js/index.js @@ -255,6 +255,7 @@ class App extends React.Component { optDoPortMapping: ['optAllInterfaces'], optPreventSleep: null, optRenderIndex: null, + optDir404: ['optRenderIndex'], port: null, }; const optAdvanced = { From 2766460b9ff3f9b81afa5ff2663d534e053d51cc Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Tue, 13 Apr 2021 13:45:32 -0500 Subject: [PATCH 006/154] Update README.md Fix cws sample image --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d99bf345..ad975da6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-app-samples/master/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store") +![Try it now in CWS](https://raw.githubusercontent.com/kzahel/web-server-chrome/master/images/200ok-128.png "Click here to install this sample from the Chrome Web Store") ## Web Server for Chrome From e6f85a9e80fc3533692b6e00a6a3e290699bc4bf Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Tue, 13 Apr 2021 14:06:48 -0500 Subject: [PATCH 007/154] Update options.js --- react-ui/js/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-ui/js/options.js b/react-ui/js/options.js index 74dc213d..e1973175 100644 --- a/react-ui/js/options.js +++ b/react-ui/js/options.js @@ -172,7 +172,7 @@ const options = { }, optDir404: { label: '404 instead of directory listing', - help: 'When no index.html is found, you will get a 404 error.', + help: 'When no index.html is found in a directory, you will get a 404 error.', type: Boolean, default: false }, From b9f8a447fe900de9370d971ec46f4796069a6a30 Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Tue, 13 Apr 2021 14:08:05 -0500 Subject: [PATCH 008/154] Update options.js --- react-ui/js/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-ui/js/options.js b/react-ui/js/options.js index e1973175..3c636775 100644 --- a/react-ui/js/options.js +++ b/react-ui/js/options.js @@ -172,7 +172,7 @@ const options = { }, optDir404: { label: '404 instead of directory listing', - help: 'When no index.html is found in a directory, you will get a 404 error.', + help: 'When no index.html is found in a directory, you will get a 404 error', type: Boolean, default: false }, From c152e43de6eacee152d2c6de02fbbb598fb57b7e Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Thu, 22 Apr 2021 12:58:41 -0500 Subject: [PATCH 009/154] Changed index of current directory message to path --- handlers.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/handlers.js b/handlers.js index 7c333464..8ac72e71 100644 --- a/handlers.js +++ b/handlers.js @@ -422,9 +422,14 @@ this.setHeader('transfer-encoding','chunked') this.writeHeaders(200) this.writeChunk(WSC.template_data ) - var html = ['', - ''] - + if (this.request.path != '') { + var html = ['', + ''] + } else { + var html = ['', + ''] + } + for (var i=0; i Date: Thu, 22 Apr 2021 13:00:28 -0500 Subject: [PATCH 010/154] Update webapp.js --- webapp.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp.js b/webapp.js index 10081e28..584456b8 100644 --- a/webapp.js +++ b/webapp.js @@ -754,3 +754,4 @@ Changes with nginx 0.7.9 12 Aug 2008 WSC.WebApplication = WebApplication })(); + From d8d2eabf8570a9f74f641a7168f3401ae16df3ce Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Tue, 27 Apr 2021 08:58:26 -0500 Subject: [PATCH 011/154] Update directory-listing-template.html --- directory-listing-template.html | 750 +++++++++++++------------------- 1 file changed, 312 insertions(+), 438 deletions(-) diff --git a/directory-listing-template.html b/directory-listing-template.html index f8a158b9..f13dae64 100644 --- a/directory-listing-template.html +++ b/directory-listing-template.html @@ -1,52 +1,48 @@ - +