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

s3_output_plugin: added new variable to enable or disable headers #9902

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions plugins/out_s3/s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int create_headers(struct flb_s3 *ctx, char *body_md5,
if (ctx->content_type != NULL) {
headers_len++;
}
if (ctx->compression == FLB_AWS_COMPRESS_GZIP) {
if (ctx->compression == FLB_AWS_COMPRESS_GZIP && ctx->enable_content_encoding_header) {
headers_len++;
}
if (ctx->canned_acl != NULL) {
Expand Down Expand Up @@ -171,7 +171,7 @@ int create_headers(struct flb_s3 *ctx, char *body_md5,
s3_headers[n].val_len = strlen(ctx->content_type);
n++;
}
if (ctx->compression == FLB_AWS_COMPRESS_GZIP) {
if (ctx->compression == FLB_AWS_COMPRESS_GZIP && ctx->enable_content_encoding_header) {
s3_headers[n] = content_encoding_header;
n++;
}
Expand Down Expand Up @@ -2376,6 +2376,11 @@ static struct flb_config_map config_map[] = {
"Defaults to no compression. "
"If 'gzip' is selected, the Content-Encoding HTTP Header will be set to 'gzip'."
},
{
FLB_CONFIG_MAP_BOOL, "enable_content_encoding_header", "true",
0, FLB_TRUE, offsetof(struct flb_s3, enable_content_encoding_header),
"Set to false to disable the Content-Encoding: gzip header."
},
{
FLB_CONFIG_MAP_STR, "content_type", NULL,
0, FLB_FALSE, 0,
Expand Down
1 change: 1 addition & 0 deletions plugins/out_s3/s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ struct flb_s3 {
int send_content_md5;
int static_file_path;
int compression;
int enable_content_encoding_header;
int port;
int insecure;
size_t store_dir_limit_size;
Expand Down