Skip to content

Commit

Permalink
fix: Correctly Set Location on non-RDF Notifications
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CxRes committed Oct 24, 2024
1 parent 2da77b0 commit 44dc0bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions lib/handlers/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ function handler (req, res, next) {
mediaType
})}`
} else {
return defaultNotification({
...(res.method === 'POST') && { location: res.getHeader('Content-Location') }
})
return defaultNotification()
}
}
})
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 44dc0bc

Please sign in to comment.