diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index fb392828a42ac..c358a42f8ee03 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -2549,6 +2549,9 @@ bool RGWSwiftWebsiteHandler::is_web_dir() const return false; } else if (subdir_name.back() == '/') { subdir_name.pop_back(); + if (subdir_name.empty()) { + return false; + } } rgw_obj obj(s->bucket, std::move(subdir_name));