Skip to content

Commit 57b9f4b

Browse files
committed
perf: remove argument reassignment
1 parent 8ccf1a3 commit 57b9f4b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ unreleased
44
* perf: enable strict mode
55
* perf: hoist regular expression
66
* perf: parse with regular expressions
7+
* perf: remove argument reassignment
78

89
1.0.1 / 2015-05-04
910
==================

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ var userPassRegExp = /^([^:]*):(.*)$/
4646
*/
4747

4848
function auth(req) {
49-
req = req.req || req;
49+
// get header
50+
var header = (req.req || req).headers.authorization
5051

5152
// parse header
5253
var header = req.headers.authorization

0 commit comments

Comments
 (0)