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: adjust the request_uri to support absoluteURI of http request #7675

Merged
merged 1 commit into from Mar 10, 2016

Conversation

wenjun-huang
Copy link

http://tracker.ceph.com/issues/12917 Fixes: #12917

Signed-off-by: Wenjun Huang wenjunhuang@tencent.com

Continuously discuss for the original pull request #5774

@mattbenjamin
Copy link
Contributor

My updated comment is, it would be useful to describe in the commit msg or source how the need for this arises, and what a candidate URL being transformed is. Thanks!

@wenjun-huang
Copy link
Author

The originated cause for this issue described in the tracker http://tracker.ceph.com/issues/12917. Refer to aws/aws-sdk-go#344, you can find the example. And for the absoluteURI scenario, the variables reaching RGW are as below:
request_uri = http://bucket.s3.amazonaws.com/path/to/file.jpg
The RGW can not deal with the request_uri, because it want it as /path/to/file.jpg. So we should do a transformation for it.

@yehudasa
Copy link
Member

@VMCloud can you modify the commit description to include your last comment?

http://tracker.ceph.com/issues/12917 Fixes: ceph#12917

The requestURI transferred from the frontend can be abs_path or absoluteURI
If it is absoluteURI, we should adjust it to abs_path for the following
S3 authorization and some other processes depending on the requestURI
The absoluteURI can start with "http://", "https://", "ws://" or "wss://"

Signed-off-by: Wenjun Huang <wenjunhuang@tencent.com>
@wenjun-huang
Copy link
Author

Hi @yehudasa, I have updated the commit description, thanks!

@mattbenjamin
Copy link
Contributor

This passed my S3 smoke tests

mattbenjamin added a commit that referenced this pull request Mar 10, 2016
rgw: adjust the request_uri to support absoluteURI of http request
@mattbenjamin mattbenjamin merged commit 70d3e13 into ceph:master Mar 10, 2016
@tdsparrow
Copy link

I tested jewel containing this PR with example listObject.go from aws-sdk-go. This client sent absolute URI in HTTP Header and it still hit issue http://tracker.ceph.com/issues/12917

This PR only affect code since civetweb_callback, however process_new_connection in civetweb still check uri and failed on absolute uri. Backtrace should looks like

(gdb) bt
#0  civetweb_callback (conn=0x7fdd4003f6c0) at rgw/rgw_civetweb_frontend.cc:8
#1  0x00007fdd691952ef in handle_request (conn=conn@entry=0x7fdd4003f6c0) at civetweb/src/civetweb.c:5795
#2  0x00007fdd691972d8 in process_new_connection (conn=0x7fdd4003f6c0) at civetweb/src/civetweb.c:6576
#3  worker_thread_run (thread_func_param=0x7fdd6992b2e0) at civetweb/src/civetweb.c:6684
#4  worker_thread (thread_func_param=0x7fdd6992b2e0) at civetweb/src/civetweb.c:6719
#5  0x00007fdd5ec8cdf5 in start_thread () from /lib64/libpthread.so.0
#6  0x00007fdd5e2991ad in clone () from /lib64/libc.so.6

We'd still need fix from civetweb: civetweb/civetweb#197

@solaiperi
Copy link

I was trying to use AWS Go SDK against Ceph (in a version where this fix is already there) and still this is not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants