summary refs log tree commit diff
path: root/patches/body-parser+1.20.1.patch
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-16 21:46:50 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-16 21:46:50 +1000
commit164fcc25f3dd0059cd630a6967d3fe199277d8f6 (patch)
tree878916e9353f9b5b71cc71ee7c6eff30ea8d9fde /patches/body-parser+1.20.1.patch
parentfix style action (diff)
downloadserver-164fcc25f3dd0059cd630a6967d3fe199277d8f6.tar.xz
Fix body-parser errors not being filtered in ErrorHandler middleware
Diffstat (limited to 'patches/body-parser+1.20.1.patch')
-rw-r--r--patches/body-parser+1.20.1.patch11
1 files changed, 10 insertions, 1 deletions
diff --git a/patches/body-parser+1.20.1.patch b/patches/body-parser+1.20.1.patch
index 054e24f7..11d1a9d1 100644
--- a/patches/body-parser+1.20.1.patch
+++ b/patches/body-parser+1.20.1.patch
@@ -1,5 +1,5 @@
 diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js
-index c2745be..7104cfa 100644
+index c2745be..17c2cfe 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')
@@ -28,3 +28,12 @@ index c2745be..7104cfa 100644
    } catch (e) {
      return normalizeJsonSyntaxError(e, {
        message: e.message.replace('#', char),
+@@ -216,7 +217,7 @@ function normalizeJsonSyntaxError (error, obj) {
+   }
+ 
+   // replace stack before message for Node.js 0.10 and below
+-  error.stack = obj.stack.replace(error.message, obj.message)
++  error.stack = obj.stack?.replace(error.message, obj.message)
+   error.message = obj.message
+ 
+   return error