From b8a3baffddb0f0082a9b250693d26d934eaf2650 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Thu, 24 May 2018 16:09:01 -0400 Subject: [PATCH] rgw: add configurable AWS-compat invalid range get behavior If rgw_ignore_get_invalid_range is set, treat invalid range restrictions as a request for the full object. By default, retain the RGW behavior to fail with ERANGE. Fixes: http://tracker.ceph.com/issues/24317 Signed-off-by: Matt Benjamin --- src/common/legacy_config_opts.h | 1 + src/common/options.cc | 6 ++++ src/rgw/rgw_op.cc | 61 +++++++++++++++++++-------------- src/rgw/rgw_op.h | 3 ++ 4 files changed, 45 insertions(+), 26 deletions(-) diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 5597b62548495..cdaf6f1f8818a 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1299,6 +1299,7 @@ OPTION(rgw_lc_max_objs, OPT_INT) OPTION(rgw_lc_debug_interval, OPT_INT) // Debug run interval, in seconds OPTION(rgw_script_uri, OPT_STR) // alternative value for SCRIPT_URI if not set in request OPTION(rgw_request_uri, OPT_STR) // alternative value for REQUEST_URI if not set in request +OPTION(rgw_ignore_get_invalid_range, OPT_BOOL) // treat invalid (e.g., negative) range requests as full OPTION(rgw_swift_url, OPT_STR) // the swift url, being published by the internal swift auth OPTION(rgw_swift_url_prefix, OPT_STR) // entry point for which a url is considered a swift url OPTION(rgw_swift_auth_url, OPT_STR) // default URL to go and verify tokens for v1 auth (if not using internal swift auth) diff --git a/src/common/options.cc b/src/common/options.cc index 5768f2755909e..14865f9a0988f 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -5080,6 +5080,12 @@ std::vector