rule out html accepting requests from json path in case of very broad accept headers
This commit is contained in:
parent
ab44393c0b
commit
b469abc863
1 changed files with 5 additions and 1 deletions
|
@ -14,7 +14,11 @@ function activity (req, res, next) {
|
|||
}
|
||||
|
||||
function jsonld (req, res, next) {
|
||||
if (req.method === 'GET' && req.accepts(pub.consts.jsonldTypes)) {
|
||||
if (
|
||||
req.method === 'GET' && !req.accepts('html') &&
|
||||
req.accepts(pub.consts.jsonldTypes)
|
||||
) {
|
||||
// rule out html because some browsers accept */* at end of list
|
||||
return next()
|
||||
}
|
||||
if (req.method === 'POST' && req.is(pub.consts.jsonldTypes)) {
|
||||
|
|
Loading…
Reference in a new issue