Update to allow CORS as API on revision actions
This commit is contained in:
parent
72d7ba0f31
commit
55ac4dcccb
1 changed files with 14 additions and 0 deletions
|
@ -335,6 +335,13 @@ function actionRevision(req, res, note) {
|
||||||
if (!content) {
|
if (!content) {
|
||||||
return response.errorNotFound(res);
|
return response.errorNotFound(res);
|
||||||
}
|
}
|
||||||
|
res.set({
|
||||||
|
'Access-Control-Allow-Origin': '*', //allow CORS as API
|
||||||
|
'Access-Control-Allow-Headers': 'Range',
|
||||||
|
'Access-Control-Expose-Headers': 'Cache-Control, Content-Encoding, Content-Range',
|
||||||
|
'Cache-Control': 'private', // only cache by client
|
||||||
|
'X-Robots-Tag': 'noindex, nofollow' // prevent crawling
|
||||||
|
});
|
||||||
res.send(content);
|
res.send(content);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -349,6 +356,13 @@ function actionRevision(req, res, note) {
|
||||||
var out = {
|
var out = {
|
||||||
revision: data
|
revision: data
|
||||||
};
|
};
|
||||||
|
res.set({
|
||||||
|
'Access-Control-Allow-Origin': '*', //allow CORS as API
|
||||||
|
'Access-Control-Allow-Headers': 'Range',
|
||||||
|
'Access-Control-Expose-Headers': 'Cache-Control, Content-Encoding, Content-Range',
|
||||||
|
'Cache-Control': 'private', // only cache by client
|
||||||
|
'X-Robots-Tag': 'noindex, nofollow' // prevent crawling
|
||||||
|
});
|
||||||
res.send(out);
|
res.send(out);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue