Skip to content

Commit fb57b41

Browse files
committed
test: response origin avoid *
1 parent 5c62a34 commit fb57b41

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
],
2020
"license": "BSD-3-Clause",
2121
"dependencies": {
22-
"@envelop/graphql-jit": "^4.2.1",
22+
"@envelop/graphql-jit": "4.2.1",
2323
"@graphql-tools/stitch": "6.2.4",
2424
"@graphql-tools/utils": "6.2.4",
25-
"@graphql-yoga/node": "2.5.0-canary-205d67f.0",
25+
"@graphql-yoga/node": "2.5.0-canary-592080c.0",
2626
"@parse/fs-files-adapter": "1.2.2",
2727
"@parse/push-adapter": "4.1.2",
2828
"bcryptjs": "2.4.3",

spec/ParseGraphQLServer.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ describe('ParseGraphQLServer', () => {
486486
}
487487
});
488488

489-
it('should be cors enabled', async () => {
489+
it('should be cors enabled and scope the response within the source origin', async () => {
490490
let checked = false;
491491
const apolloClient = new ApolloClient({
492492
link: new ApolloLink((operation, forward) => {
@@ -495,7 +495,7 @@ describe('ParseGraphQLServer', () => {
495495
const {
496496
response: { headers },
497497
} = context;
498-
expect(headers.get('access-control-allow-origin')).toEqual('*');
498+
expect(headers.get('access-control-allow-origin')).toEqual('http://someorigin.com');
499499
checked = true;
500500
return response;
501501
});
@@ -9414,9 +9414,9 @@ describe('ParseGraphQLServer', () => {
94149414
body,
94159415
});
94169416

9417-
expect(res.status).toEqual(200);
94189417
const result = JSON.parse(await res.text());
9419-
expect(result.errors).toBeDefined();
9418+
expect(res.status).toEqual(500);
9419+
expect(result.errors[0].message).toEqual('File size limit exceeded: 1024 bytes');
94209420
});
94219421

94229422
it('should support object values', async () => {

src/GraphQL/ParseGraphQLServer.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ class ParseGraphQLServer {
8181
requiredParameter('You must provide an Express.js app instance!');
8282
}
8383

84-
/*this._transformMaxUploadSizeToBytes(
85-
this.parseServer.config.maxUploadSize || '20mb'
86-
)*/
8784
app.use(this.config.graphQLPath, corsMiddleware());
8885
app.use(this.config.graphQLPath, handleParseHeaders);
8986
app.use(this.config.graphQLPath, handleParseErrors);

0 commit comments

Comments
 (0)