Do not return HTTP 500 when cross-site request forgery token is invalid for in-person proofing API#7950
Merged
mitchellhenke merged 1 commit intomainfrom Mar 9, 2023
Conversation
…id for in-person proofing API changelog: Internal, In-Person Proofing, Do not return HTTP 500 when cross-site request forgery token is invalid
zachmargolis
reviewed
Mar 8, 2023
| Faraday::TimeoutError => :unprocessable_entity, | ||
| Faraday::BadRequestError => :unprocessable_entity, | ||
| Faraday::ForbiddenError => :unprocessable_entity, | ||
| ActionController::InvalidAuthenticityToken => :unprocessable_entity, |
Contributor
There was a problem hiding this comment.
could we add a controller-level
protect_from_forgery with: :reset_sessionso that it never throws an error in the first place?
Contributor
Author
There was a problem hiding this comment.
I'm not sure on the best strategy since this is an API and mostly copied what's already here, I'm primarily wanting to not return a 500. I'd defer to the folks on Joy.
allthesignals
approved these changes
Mar 9, 2023
Contributor
allthesignals
left a comment
There was a problem hiding this comment.
This looks good… unprocessable_entity is 4xx level, right?
Contributor
|
jmdembe
pushed a commit
that referenced
this pull request
Mar 9, 2023
…id for in-person proofing API (#7950) changelog: Internal, In-Person Proofing, Do not return HTTP 500 when cross-site request forgery token is invalid
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary of changes
We've seen a handful of these recently, and I think it's an error we want to avoid returning a 500 status on.