Skip to content

Commit a19a196

Browse files
aduh95targostniessen
authored
Apply suggestions from code review
Co-authored-by: Michaël Zasso <[email protected]> Co-authored-by: Tobias Nießen <[email protected]>
1 parent ce13b38 commit a19a196

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/api/http.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3589,6 +3589,8 @@ added: REPLACEME
35893589
files are filtered. **Default:** filters all dot files.
35903590
* `log` {Function|null} called when sending a response to the client.
35913591
**Default:** `console.log`.
3592+
* `statusCode` {integer} The status code that is sent to the client.
3593+
* `url` {string} the (origin-relative) URL that was requested.
35923594
* `onStart` {Function} called the server starts listening to requests.
35933595
**Default:** logs the URL to the console.
35943596

@@ -3600,10 +3602,10 @@ When specifying a `host` other than `localhost`, you are exposing your local
36003602
file system to all the machines that can connect to your computer.
36013603

36023604
If specified and not `null`, `filter` will be called with two arguments: the
3603-
first one if the request URL string (the URL that is present in the actual HTTP
3605+
first one is the request URL string (the URL that is present in the actual HTTP
36043606
request), and the second one is the `file:` `URL` that was generated from the
36053607
base directory and the request URL. If the function returns a falsy value, the
3606-
request will be blocked.
3608+
server will respond with a 403 HTTP error.
36073609

36083610
If `port` is omitted or is 0, the operating system will assign an arbitrary
36093611
unused port, which it's output will be the standard output.

lib/internal/http/static.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ function createStaticServer(options = kEmptyObject) {
7171
'.jpg': 'image/jpeg',
7272
'.jpeg': 'image/jpeg',
7373
'.png': 'image/png',
74+
'.wasm': 'application/wasm',
7475
'.webp': 'image/webp',
7576
'.woff2': 'font/woff2',
7677
...mimeOverrides,

0 commit comments

Comments
 (0)