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: return valid Location element, CompleteMultipartUpload #19902

Merged
merged 1 commit into from Feb 2, 2018

Conversation

mattbenjamin
Copy link
Contributor

Returns URIs that should reach the server regardless of domain
configuration, and following tenant:bucket convention, if
applicable.

Fixes: https://tracker.ceph.com/issues/22655

Signed-off-by: Matt Benjamin mbenjamin@redhat.com

}
return domain;
}();
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for wrapping the code with the immediately executed lambda?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just permits lining it into the ternary assignment expr. most likely this should be consolidated into a routine, but I don't know where all it should be used yet

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, having a routine for that sounds nice. We might also want to unify with dump_uri_from_state of rgw_rest.cc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

does my routine (based on the code formerly in this location but adjusted for tenant) do the right thing? dump_uri_from_state() is different, ignores tenants, deals with domain differently; need to get it right for all cases...

Copy link
Contributor

Choose a reason for hiding this comment

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

<Location> crafted in the new way is definitely more consistent with examples from the AWS doc. The last thing I see is the HTTPS case.

Actually dump_uri_from_state looks like a dead code. I will make a patch to drop it.

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 that's a big help, I'll update this one with the cleanups

s->info.domain.c_str());
std::string domain = (!s->info.domain.empty()) ? s->info.domain :
[&]() -> std::string {
std::string domain = "http://";
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we consider HTTPS here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I thought of that after typing. And we make this same mistake elsewhere. But are we supposed to just pick http/s, or match the incoming proto?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should stick to the incoming proto, I bet.

Returns URIs that should reach the server regardless of domain
configuration, and following tenant:bucket convention, if
applicable.

Fixes: https://tracker.ceph.com/issues/22655

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
@yehudasa yehudasa self-requested a review January 18, 2018 18:51
Copy link
Member

@yehudasa yehudasa left a comment

Choose a reason for hiding this comment

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

lgtm

@mattbenjamin
Copy link
Contributor Author

@mattbenjamin mattbenjamin merged commit dcdb7ab into ceph:master Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants