This repository was archived by the owner on Jul 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
This repository was archived by the owner on Jul 26, 2020. It is now read-only.
422 Unprocessable Entity on push #5
Copy link
Copy link
Open
Description
I'm getting a 422 Unprocessable Entity error from node-git-lfs when trying to push to the server using git-lfs/2.11.0.
I dug in to it and it looks like the error is thrown when validating the batch request here:
node-git-lfs/lib/routes/batch.js
Lines 100 to 110 in ebbe7d8
| app.post('/:user/:repo/objects/batch', wrap(function* (req, res, next) { | |
| // validate request body according to JSON Schema | |
| try { | |
| var body = yield parse.json(req); | |
| req.jsonBody = body; | |
| var valid = validate(body, BATCH_REQUEST_SCHEMA).valid; | |
| if (!valid) { | |
| let err = new Error(); | |
| err.status = 422; | |
| next(err); | |
| } else { |
My git-lfs client sends through a body that looks like this
{ operation: 'upload',
objects:
[ { oid:
'19f2dcd3b4f260b2d6e5cdec56c58d2b150526b262cb0ca15b8d86eb6398d3dd',
size: 386583 } ],
transfers: [ 'lfs-standalone-file', 'basic' ],
ref: { name: 'refs/heads/master' } }I think the transfers and ref keys are failed by the JSON schema validation. Removing this line from the schema makes everything work smoothly:
| "additionalProperties": false |
Metadata
Metadata
Assignees
Labels
No labels