Actions
Bug #27654
openStrange behavior of the S3 Get Bucket lifecycle when the Origin header is included in the request
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:
0%
Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
Steps to Reproduce
- Create a bucket.
- Request S3 Get Bucket lifecycle API with Origin header.
Actual results
<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchLifecycleConfiguration</Code><BucketName>bucketname</BucketName><RequestId>tx00000000000000000003b-005b83b71e-11cc-default</RequestId><HostId>11cc-default-default</HostId></Error><LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"></LifecycleConfiguration>
Expected results
<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchLifecycleConfiguration</Code><BucketName>bucketname</BucketName><RequestId>tx00000000000000000003c-005b83b72f-11cc-default</RequestId><HostId>11cc-default-default</HostId></Error>
It seems that the value of op_ret changed in end_header.
https://github.com/ceph/ceph/blob/luminous/src/rgw/rgw_rest_s3.cc#L2259
void RGWGetLC_ObjStore_S3::send_response()
{
if (op_ret) {
if (op_ret == -ENOENT) {
set_req_state_err(s, ERR_NO_SUCH_LC);
} else {
set_req_state_err(s, op_ret);
}
}
dump_errno(s);
end_header(s, this, "application/xml"); <-- op_ret value is changed here.
dump_start(s);
if (op_ret < 0)
return;
config.dump_xml(s->formatter);
rgw_flush_formatter_and_reset(s, s->formatter);
}
Actions