-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return HTTP status code 415 from endpoints that expect JSON (#26)
axum::Json already does that, but our EthJson and Error were replacing its status codes with 400. The solution was to store JsonRejection directly in Error and delegate to it in Error::status_code. Doing so also makes endpoints return status codes 413 and 422 when appropriate. The duplicated rejection messages came up again. We were able to determine the cause and come up with a better workaround this time. The issue should be fixed for query strings too.
- Loading branch information
1 parent
9824c25
commit 2fff399
Showing
6 changed files
with
116 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,10 @@ authors = ["Grandine <[email protected]>"] | |
workspace = true | ||
|
||
[dependencies] | ||
axum = { workspace = true } | ||
anyhow = { workspace = true } | ||
arithmetic = { workspace = true } | ||
axum = { workspace = true } | ||
axum-extra = { workspace = true } | ||
bls = { workspace = true } | ||
builder_api = { workspace = true } | ||
cached = { workspace = true } | ||
|
Oops, something went wrong.