OPTION(rgw_swift_auth_url, OPT_STR, "") // default URL to go and verify tokens for v1 auth (if not using internal swift auth)
OPTION(rgw_swift_auth_entry, OPT_STR, "auth") // entry point for which a url is considered a swift auth url
OPTION(rgw_swift_tenant_name, OPT_STR, "") // tenant name to use for swift access
+OPTION(rgw_swift_enforce_content_length, OPT_BOOL, false) // enforce generation of Content-Length even in cost of performance or scalability
OPTION(rgw_keystone_url, OPT_STR, "") // url for keystone server
OPTION(rgw_keystone_admin_token, OPT_STR, "") // keystone admin token (shared secret)
OPTION(rgw_keystone_admin_user, OPT_STR, "") // keystone admin user name
ret = STATUS_NO_CONTENT;
set_req_state_err(s, ret);
}
- dump_errno(s);
- end_header(s, NULL, NULL, true);
+
+ if (!g_conf->rgw_swift_enforce_content_length) {
+ dump_errno(s);
+ end_header(s, NULL, NULL, NO_CONTENT_LENGTH, true);
+ }
if (!ret) {
dump_start(s);
s->formatter->dump_int("bytes", obj.size);
}
s->formatter->close_section();
- rgw_flush_formatter(s, s->formatter);
+ if (!g_conf->rgw_swift_enforce_content_length) {
+ rgw_flush_formatter(s, s->formatter);
+ }
}
}
{
if (sent_data) {
s->formatter->close_section();
+ }
+
+ if (g_conf->rgw_swift_enforce_content_length) {
+ dump_errno(s);
+ end_header(s, NULL, NULL, s->formatter->get_len(), true);
+ }
+
+ if (sent_data || g_conf->rgw_swift_enforce_content_length) {
rgw_flush_formatter_and_reset(s, s->formatter);
}
}