Skip to content
This repository was archived by the owner on Aug 10, 2023. It is now read-only.

Commit 9931a37

Browse files
committed
Merge pull request #9 from restify/static
cherry-pick changes from 5.x core
2 parents 7e4a78d + 2d845ce commit 9931a37

4 files changed

Lines changed: 29 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

CHANGES.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1-
# 1.x.x
1+
# 1.0.2
22

3-
* NEW: `bodyParser` plugin now saves the raw unparsed body on req.rawBody
3+
- merges [commit](https://github.com/restify/node-restify/commit/fbd56f5751f82031c8b0e677f0bdd677c7b95892)
4+
from restify core that fixes errors for static plugin
5+
6+
# 1.0.1
7+
8+
- audit log now has a `clientClosed` attribute that denotes whether or not the
9+
req was closed/terminated by the client
10+
11+
# 1.0.0
12+
13+
### Internal changes
14+
- move unit migrated to mocha
15+
- unit tests separated into their own files
16+
17+
### Breaking changes
18+
- plugins moved into their own repository
19+
- `sanitizePath` now available only on the `pre` export
20+
- `mapParams: false` is now the default setting for both the queryParser and
21+
bodyParser plugins
22+
- request expiration plugin now has two options, absolute time and timeout, the
23+
signature of the options has changed.
24+
- Add printLog flag to audit logger to optionally print log, by default is true.
25+
- Server emit auditlog event with log obj. Optionally store logs in ringbuffer.
26+
- `bodyParser` plugin now saves the raw unparsed body on req.rawBody

lib/plugins/static.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ function serveStatic(options) {
4444

4545
function serveFileFromStats(file, err, stats, isGzip, req, res, next) {
4646
if (err) {
47-
next(new ResourceNotFoundError(err,
48-
req.path()));
47+
next(new ResourceNotFoundError(err, '%s', req.path()));
4948
return;
5049
} else if (!stats.isFile()) {
5150
next(new ResourceNotFoundError('%s does not exist', req.path()));
@@ -125,12 +124,12 @@ function serveStatic(options) {
125124
}
126125

127126
if (!re.test(file.replace(/\\/g, '/'))) {
128-
next(new NotAuthorizedError(req.path()));
127+
next(new NotAuthorizedError('%s', req.path()));
129128
return;
130129
}
131130

132131
if (opts.match && !opts.match.test(file)) {
133-
next(new NotAuthorizedError(req.path()));
132+
next(new NotAuthorizedError('%s', req.path()));
134133
return;
135134
}
136135

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"Ben Hale",
1414
"Ben Hutchinson",
1515
"Benjamine Coe",
16+
"Benjamin Urban",
1617
"Blake VanLandingham",
1718
"Bryce Kahle",
1819
"Christopher Cannell",

0 commit comments

Comments
 (0)