Reject an empty body on VWS endpoints which take JSON - #3551
Merged
Merged
Conversation
An empty body given to POST /targets, PUT /targets/{id},
POST /targets/{id}/instances or the reco counts report endpoint raised an
uncaught JSONDecodeError from validate_keys, because validate_json
returned early for an empty body.
Match real Vuforia instead: 500 Fail for the target endpoints, 400 Fail
for the reco counts report and 400 BadRequest for instance generation.
Add a test which runs against real Vuforia, since an empty body is
answered promptly unlike other malformed bodies.
Closes #3550
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
adamtheturtle
temporarily deployed
to
development
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 6, 2026 17:49 — with
GitHub Actions
Inactive
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.
Closes #3550.
An empty body given to
POST /targets,PUT /targets/{target_id},POST /targets/{target_id}/instancesor the reco counts report endpoint raised an uncaughtJSONDecodeErrorfromvalidate_keys, becausevalidate_jsonreturned early for an empty body.This matches real Vuforia instead. I checked each endpoint against the real service with a correctly signed empty body, which differs from the response suggested in the issue:
POST /targetsFailPUT /targets/{target_id}FailPOST /targets/{target_id}/instancesBadRequestPOST /imagetargets/databases/{database_id}/reports/recoCountsFailvalidate_jsonnow takes the request method and rejects an empty body onPOSTandPUTwith those responses.GETandDELETErequests are unaffected.The new
test_empty_bodyruns against real Vuforia as well as the mock backends. Unlike the other malformed bodies whichtest_invalid_json.pysends, real Vuforia answers an empty body promptly, so it is not in the real-Vuforia skip list. It skips the endpoints which do not take JSON before sending anything, so it costs one request per JSON endpoint. The new test is added to the CIci_patternlist and passes on all three backends locally.🤖 Generated with Claude Code