-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use 502 status code for hash mismatches in diff server (#497)
When using the diff server, you can provide a hash to verify that the two pieces of content you are diffing were correctly received. When that hash doesn’t match, we used to respond with a 500 error, but we now use a 502 error to clarify that the problem is related to the upstream server, not us. Since that can be a little ambiguous (502 = hash mismatch, but also 502 = upstream server error), this also adds a mechanism for sending extra metadata with the error. Specifically, you can now check `error.type` in the response for a more detailed error code, like `HASH_MISMATCH` or `UPSTREAM_ERROR`. Fixes #491.
- Loading branch information
Showing
2 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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