Skip to content

Commit

Permalink
Merge pull request #39 from karankohli13/master
Browse files Browse the repository at this point in the history
fixed Cannot redefine property: clientIp error
  • Loading branch information
pbojinov authored Oct 29, 2018
2 parents afe3230 + 0190f60 commit 6a48072
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ function mw(options) {
Object.defineProperty(req, attributeName, {
get: function get() {
return ip;
}
},
configurable: true
});
next();
};
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function mw(options) {
const ip = getClientIp(req);
Object.defineProperty(req, attributeName, {
get: () => ip,
configurable: true
});
next();
};
Expand Down

0 comments on commit 6a48072

Please sign in to comment.