-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement/arsn 422 support post object #2248
base: development/7.70
Are you sure you want to change the base?
Improvement/arsn 422 support post object #2248
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
@@ -58,6 +58,10 @@ export default function routePOST( | |||
corsHeaders)); | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed in the most recent updates I made, please re-open if you see otherwise
lib/s3routes/routes/routePOST.ts
Outdated
@@ -58,6 +58,10 @@ export default function routePOST( | |||
corsHeaders)); | |||
} | |||
|
|||
if (objectKey === undefined && Object.keys(query).length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e109d2d
Tested here
scality/cloudserver@0d40c42
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -247,7 +247,7 @@ export const InvalidURI: ErrorFormat = { | |||
description: "Couldn't parse the specified URI.", | |||
}; | |||
|
|||
export const KeyTooLong: ErrorFormat = { | |||
export const KeyTooLongError: ErrorFormat = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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