Skip to content
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

rgw/swift: fix updating metadata failed for swift CORS #10411

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rgw/rgw_op.cc
Expand Up @@ -3130,7 +3130,7 @@ void RGWPutMetadataBucket::execute()
if (has_cors) {
buffer::list bl;
cors_config.encode(bl);
emplace_attr(RGW_ATTR_CORS, std::move(bl));
attrs[RGW_ATTR_CORS] = std::move(bl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit surprising. From the code I can deduce the assumption that RGW_ATTR_CORS (and its current value from the RADOS store) shouldn't be present in RGWPutMetadataBucket::attrs at this phase. I need to debug this further.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rzarzynski thanks, yeh, I have tested this as the steps mentioned above and it worked as expected.

}

/* It's supposed that following functions WILL NOT change any special
Expand Down
4 changes: 1 addition & 3 deletions src/rgw/rgw_swift_auth.cc
Expand Up @@ -387,9 +387,7 @@ static int encode_token(CephContext *cct, string& swift_user, string& key,
utime_t expiration = ceph_clock_now(cct);
expiration += cct->_conf->rgw_swift_token_expiration;

ret = build_token(swift_user, key, nonce, expiration, bl);

return ret;
return build_token(swift_user, key, nonce, expiration, bl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

}


Expand Down