Skip to content

Commit 8a6a360

Browse files
New build
1 parent adeb422 commit 8a6a360

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

commonjs/duplex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Object.defineProperty(exports, "__esModule", { value: true });
22
/*!
33
* https://github.com/Starcounter-Jack/JSON-Patch
4-
* (c) 2017 Joachim Wester
4+
* (c) 2017-2021 Joachim Wester
55
* MIT license
66
*/
77
var helpers_js_1 = require("./helpers.js");

dist/fast-json-patch.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,10 @@ function applyOperation(document, operation, validateOperation, mutateDocument,
467467
if (key && key.indexOf('~') != -1) {
468468
key = helpers_js_1.unescapePathComponent(key);
469469
}
470-
if (banPrototypeModifications && key == '__proto__') {
471-
throw new TypeError('JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');
470+
if (banPrototypeModifications &&
471+
(key == '__proto__' ||
472+
(key == 'prototype' && t > 0 && keys[t - 1] == 'constructor'))) {
473+
throw new TypeError('JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');
472474
}
473475
if (validateOperation) {
474476
if (existingPathFragment === undefined) {
@@ -742,7 +744,7 @@ exports.unescapePathComponent = helpers.unescapePathComponent;
742744
Object.defineProperty(exports, "__esModule", { value: true });
743745
/*!
744746
* https://github.com/Starcounter-Jack/JSON-Patch
745-
* (c) 2017 Joachim Wester
747+
* (c) 2017-2021 Joachim Wester
746748
* MIT license
747749
*/
748750
var helpers_js_1 = __webpack_require__(0);

0 commit comments

Comments
 (0)