diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-02 20:37:25 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-02 20:37:25 +1100 |
commit | 5ef4b80fc54db92467961ee8190f1fc93e8b4b71 (patch) | |
tree | 5165a3937f8204bf68829aaa6d829481a6693541 /patches/body-parser+1.20.1.patch | |
parent | Use adjusted email in /auth/login (diff) | |
parent | Profile themes and pronouns (diff) | |
download | server-5ef4b80fc54db92467961ee8190f1fc93e8b4b71.tar.xz |
Merge pull request #922 from MaddyUnderStars/maddy/bodyParserPatch
Patch body-parser to use json-bigint, like gateway
Diffstat (limited to 'patches/body-parser+1.20.1.patch')
-rw-r--r-- | patches/body-parser+1.20.1.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/patches/body-parser+1.20.1.patch b/patches/body-parser+1.20.1.patch new file mode 100644 index 00000000..054e24f7 --- /dev/null +++ b/patches/body-parser+1.20.1.patch @@ -0,0 +1,30 @@ +diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js +index c2745be..7104cfa 100644 +--- a/node_modules/body-parser/lib/types/json.js ++++ b/node_modules/body-parser/lib/types/json.js +@@ -18,6 +18,7 @@ var createError = require('http-errors') + var debug = require('debug')('body-parser:json') + var read = require('../read') + var typeis = require('type-is') ++var JSONbig = require("json-bigint"); + + /** + * Module exports. +@@ -86,7 +87,7 @@ function json (options) { + + try { + debug('parse json') +- return JSON.parse(body, reviver) ++ return JSONbig.parse(body, reviver) + } catch (e) { + throw normalizeJsonSyntaxError(e, { + message: e.message, +@@ -157,7 +158,7 @@ function createStrictSyntaxError (str, char) { + : '' + + try { +- JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') ++ JSONbig.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') + } catch (e) { + return normalizeJsonSyntaxError(e, { + message: e.message.replace('#', char), |