Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
JSlibs built and minimal web server running
- Loading branch information
Showing
with
5 additions
and
1 deletion.
-
+5
−1
miniWebServer.js
|
@@ -226,6 +226,10 @@ function ProcessRequest( status, headers, output, close ) { |
|
|
if ( !file.exist || file.info.type != File.FILE_FILE ) { |
|
|
|
|
|
var message = 'file not found '+root+NormalizePath(status.path); |
|
|
var file = new File( root + NormalizePath(status.path) ); |
|
|
if ( !file.exist || file.info.type != File.FILE_FILE ) { |
|
|
|
|
|
var message = 'file not found'; |
|
|
output(CreateHttpHeaders( 404, {'Content-Length':message.length, 'Content-Type':'text/plain'} )); |
|
|
output(message); |
|
|
return Noop; |
|
@@ -262,6 +266,7 @@ function ProcessRequest( status, headers, output, close ) { |
|
|
var ContentEncoding = Identity; |
|
|
|
|
|
/* |
|
|
|
|
|
if ( headers.acceptencoding && headers.acceptencoding.indexOf('deflate') != -1 ) { |
|
|
|
|
|
respondeHeaders['Content-Encoding'] = 'deflate'; |
|
@@ -445,4 +450,3 @@ try { |
|
|
throw(ex); |
|
|
} |
|
|
|
|
|
|