Compare commits

...
2 Commits
Author SHA1 Message Date
Florent Vilmart 108c7e95e2 ⚡ Release 2.8.3 2018-08-07 11:21:17 -04:00
Florent Vilmart d15a3ce8f5 Adds exposed headers to avoid issue in JS SDK (#4934)
* Adds exposed headers to avoid issue in JS SDK

* Adds test for headers
2018-08-07 11:19:49 -04:00
4 changed files with 20 additions and 3 deletions
+6 -1
View File
@@ -1,7 +1,12 @@
## Parse Server Changelog
### master
[Full Changelog](https://github.com/parse-community/parse-server/compare/2.8.2...master)
[Full Changelog](https://github.com/parse-community/parse-server/compare/2.8.3...master)
### 2.8.3
[Full Changelog](https://github.com/parse-community/parse-server/compare/2.8.3...2.8.2)
* Adds support for JS SDK 2.0 job status header
### 2.8.2
[Full Changelog](https://github.com/parse-community/parse-server/compare/2.8.2...2.8.1)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "parse-server",
"version": "2.8.2",
"version": "2.8.3",
"description": "An express module providing a Parse-compatible API server",
"main": "lib/index.js",
"repository": {
+12
View File
@@ -290,4 +290,16 @@ describe('middlewares', () => {
middlewares.handleParseHeaders(fakeReq, fakeRes);
expect(fakeRes.status).toHaveBeenCalledWith(403);
});
it('should properly expose the headers', () => {
const headers = {};
const res = {
header: (key, value) => {
headers[key] = value
}
};
middlewares.allowCrossDomain({}, res, () => {});
expect(Object.keys(headers).length).toBe(4);
expect(headers['Access-Control-Expose-Headers']).toBe('X-Parse-Job-Status-Id, X-Parse-Push-Status-Id');
});
});
+1 -1
View File
@@ -247,7 +247,7 @@ export function allowCrossDomain(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
res.header('Access-Control-Allow-Headers', 'X-Parse-Master-Key, X-Parse-REST-API-Key, X-Parse-Javascript-Key, X-Parse-Application-Id, X-Parse-Client-Version, X-Parse-Session-Token, X-Requested-With, X-Parse-Revocable-Session, Content-Type');
res.header('Access-Control-Expose-Headers', 'X-Parse-Job-Status-Id, X-Parse-Push-Status-Id');
// intercept OPTIONS method
if ('OPTIONS' == req.method) {
res.sendStatus(200);