From 44dc0bce781699c2b38991fea7a0a44994cc2f6f Mon Sep 17 00:00:00 2001 From: Rahul Gupta Date: Thu, 24 Oct 2024 04:56:47 +0530 Subject: [PATCH] fix: Correctly Set Location on non-RDF Notifications When the negotiated media-type for notifications is not RDF, the `location` property is correctly set to the `Location` header in the generated notifications. Express-PREP now handles this by default. --- lib/handlers/notify.js | 4 +--- package-lock.json | 8 ++++---- package.json | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/handlers/notify.js b/lib/handlers/notify.js index fe758da1..42090cb3 100644 --- a/lib/handlers/notify.js +++ b/lib/handlers/notify.js @@ -76,9 +76,7 @@ function handler (req, res, next) { mediaType })}` } else { - return defaultNotification({ - ...(res.method === 'POST') && { location: res.getHeader('Content-Location') } - }) + return defaultNotification() } } }) diff --git a/package-lock.json b/package-lock.json index 0d1b732f..92322254 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "express-accept-events": "^0.3.0", "express-handlebars": "^5.3.5", "express-negotiate-events": "^0.3.0", - "express-prep": "^0.6.2", + "express-prep": "^0.6.3", "express-session": "^1.18.0", "extend": "^3.0.2", "from2": "^2.3.0", @@ -10852,9 +10852,9 @@ } }, "node_modules/express-prep": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/express-prep/-/express-prep-0.6.2.tgz", - "integrity": "sha512-qkEO386C6kK2BFESRozSmnsoH+zOivR/W1fSZ0YoNjJvzy+MiHnEEci/DF3TVsePfpTjt8T04qxkdsWMIPVM6w==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/express-prep/-/express-prep-0.6.3.tgz", + "integrity": "sha512-RIdkQHCi9VqE/vC1AHTMV1aggd408WLlG0z9uPqv5Tj+AzZuHj0ycEgGTgFnvafYzJCbhs208+wV2MrbFlCajQ==", "license": "MPL-2.0", "dependencies": { "crypto-random-string": "^5.0.0", diff --git a/package.json b/package.json index 8978c271..f3ea42db 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "express-accept-events": "^0.3.0", "express-handlebars": "^5.3.5", "express-negotiate-events": "^0.3.0", - "express-prep": "^0.6.2", + "express-prep": "^0.6.3", "express-session": "^1.18.0", "extend": "^3.0.2", "from2": "^2.3.0",