You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,15 +69,17 @@ with the provided Dockerfile.
69
69
|`-b` or `--brotli`|When enabled it will serve `./public/some-file.js.br` in place of `./public/some-file.js` when a brotli compressed version of the file exists and the request accepts `br` encoding. If gzip is also enabled, it will try to serve brotli first. |`false`|
70
70
|`-e` or `--ext`|Default file extension if none supplied |`html`|
71
71
|`-s` or `--silent`|Suppress log messages from output ||
72
-
|`--cors`|Enable CORS via the `Access-Control-Allow-Origin` header ||
72
+
|`--cors`|Enable CORS via the `Access-Control-Allow-Origin: *` header. Optionally provide comma-separated values to add to `Access-Control-Allow-Headers`||
73
73
|`-H` or `--header`|Add an extra response header (can be used several times) ||
74
74
|`-o [path]`|Open browser window after starting the server. Optionally provide a URL path to open. e.g.: -o /other/dir/ ||
75
75
|`-c`|Set cache time (in seconds) for cache-control max-age header, e.g. `-c10` for 10 seconds. To disable caching, use `-c-1`.|`3600`|
76
76
|`-U` or `--utc`|Use UTC time format in log messages.||
77
77
|`--log-ip`|Enable logging of the client's IP address |`false`|
78
78
|`-P` or `--proxy`|Proxies all requests which can't be resolved locally to the given url. e.g.: -P http://someurl.com||
Copy file name to clipboardExpand all lines: lib/core/index.js
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -200,9 +200,14 @@ module.exports = function createMiddleware(_dir, _options) {
200
200
path.relative(path.join('/',baseDir),pathname)
201
201
)
202
202
);
203
-
// determine compressed forms if they were to exist
203
+
// determine compressed forms if they were to exist, make sure to handle pre-compressed files, i.e. files with .br/.gz extension. we will serve them "as-is"
0 commit comments