Improvement/arsn 422 support post object#2248
Improvement/arsn 422 support post object#2248KazToozs wants to merge 7 commits intodevelopment/7.70from
Conversation
Hello kaztoozs,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
8bfbebb to
1016c27
Compare
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
lib/s3routes/routes/routePOST.ts
Outdated
| } | ||
|
|
||
| if (objectKey === undefined && Object.keys(query).length === 0) { | ||
| return api.callApiMethod('objectPost', request, response, log, (err, resHeaders) => routesUtils.responseNoBody(err, resHeaders, response, 204, log)); |
There was a problem hiding this comment.
this crash if err is not one of our error with a code, example of error sent:
Error: Unexpected end of multipart data
at /home/mickael/scality/cloudserver/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js:54:28
Producing this crash:
RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined
at new NodeError (node:internal/errors:387:5)
at ServerResponse.writeHead (node:_http_server:314:11)
at Object.errorXMLResponse [as errorResponse] (/home/mickael/scality/cloudserver/node_modules/arsenal/build/lib/s3routes/routesUtils.js:142:18)
at Object.responseNoBody (/home/mickael/scality/cloudserver/node_modules/arsenal/build/lib/s3routes/routesUtils.js:432:35)
at /home/mickael/scality/cloudserver/node_modules/arsenal/build/lib/s3routes/routes/routePOST.js:62:105
at /home/mickael/scality/cloudserver/lib/api/api.js:317:24
at /home/mickael/scality/cloudserver/node_modules/async/dist/async.js:421:16
at next (/home/mickael/scality/cloudserver/node_modules/async/dist/async.js:5302:29)
at /home/mickael/scality/cloudserver/node_modules/async/dist/async.js:906:16
at Busboy.<anonymous> (/home/mickael/scality/cloudserver/lib/api/api.js:238:32)
There was a problem hiding this comment.
This should be fixed in the most recent updates I made, please re-open if you see otherwise
lib/s3routes/routes/routePOST.ts
Outdated
| corsHeaders)); | ||
| } | ||
|
|
||
| if (objectKey === undefined && Object.keys(query).length === 0) { |
There was a problem hiding this comment.
also on post object aws returns a 400 instead of a 501 Not Implemented for query string
<Code>InvalidArgument</Code>
<Message>Query String Parameters not allowed on POST requests.</Message>
There was a problem hiding this comment.
Also before that if there is an objectKey and no query string match the previous conditions, aws returns 405 Method Not Allowed instead of 501 Not Implemented
<Code>MethodNotAllowed</Code>
<Message>The specified method is not allowed against this resource.</Message>
<Method>POST</Method>
<ResourceType>OBJECT</ResourceType>There was a problem hiding this comment.
Like this?
4ef5748
Tested
scality/cloudserver@29ebf3f
b09b46e to
1016c27
Compare
c85360c to
d8fc234
Compare
573e0ed to
03db00b
Compare
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
03db00b to
61984fb
Compare
lib/errors/arsenalErrors.ts
Outdated
| }; | ||
|
|
||
| export const KeyTooLong: ErrorFormat = { | ||
| export const KeyTooLongError: ErrorFormat = { |
There was a problem hiding this comment.
There was a problem hiding this comment.
Ok, I'll work with the old version for CS Post Object then
1f44698 to
4ef5748
Compare
Adds support for postObject API by adding the route and updating one of the relevant errors that will be handled in the first PR here