-
Notifications
You must be signed in to change notification settings - Fork 29
fix(audits): incorrect status code range #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The committers listed above are authorized under a signed CLA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, as per the spec, the expected status code should be 400 for both content-types. Would you like to make the necessary changes?
application/json
https://graphql.github.io/graphql-over-http/draft/#sec-application-json.Examples.JSON-parsing-failure
application/graphql-response+json
https://graphql.github.io/graphql-over-http/draft/#sec-application-graphql-response-json.Examples.JSON-parsing-failure
Good point! For Code for 865D and 556Agraphql-http/src/audits/server.ts Lines 672 to 689 in a49c45b
graphql-http/src/audits/server.ts Lines 690 to 706 in a49c45b
For Code for B6DC and BCF8graphql-http/src/audits/server.ts Lines 559 to 572 in a49c45b
graphql-http/src/audits/server.ts Lines 573 to 586 in a49c45b
I would proceed like this:
|
Historically we allowed 4XX which is why those cases exist, but are now obsolete.
Note that it should allow 2XX only when accepting application/json, not the new content type. Other than that, we're looking good. Thanks! |
This PR fixes the status code range assertion of audit check B6DC, which did not match the audit name/description.
graphql-http/src/audits/server.ts
Lines 559 to 572 in a49c45b
The name/description suggests 5xx status codes may be used. However, the audit function currently requires the status code to be between 400 and 499.