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: make sending Content-Length in 204 and 304 responses controllable #10156

Merged
merged 1 commit into from Feb 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/common/config_opts.h
Expand Up @@ -1486,6 +1486,7 @@ OPTION(rgw_admin_entry, OPT_STR, "admin") // entry point for which a url is con
OPTION(rgw_enforce_swift_acls, OPT_BOOL, true)
OPTION(rgw_swift_token_expiration, OPT_INT, 24 * 3600) // time in seconds for swift token expiration
OPTION(rgw_print_continue, OPT_BOOL, true) // enable if 100-Continue works
OPTION(rgw_print_prohibited_content_length, OPT_BOOL, false) // violate RFC 7230 and send Content-Length in 204 and 304
OPTION(rgw_remote_addr_param, OPT_STR, "REMOTE_ADDR") // e.g. X-Forwarded-For, if you have a reverse proxy
OPTION(rgw_op_thread_timeout, OPT_INT, 10*60)
OPTION(rgw_op_thread_suicide_timeout, OPT_INT, 0)
Expand Down
3 changes: 2 additions & 1 deletion src/rgw/rgw_client_io_filters.h
Expand Up @@ -291,7 +291,8 @@ class ConLenControllingFilter : public DecoratedRestfulClient<T> {

size_t send_status(const int status,
const char* const status_name) override {
if (204 == status || 304 == status) {
if ((204 == status || 304 == status) &&
! g_conf->rgw_print_prohibited_content_length) {
action = ContentLengthAction::INHIBIT;
} else {
action = ContentLengthAction::FORWARD;
Expand Down