We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74e0e51 commit 912b7d7Copy full SHA for 912b7d7
plugins/out_es/es.c
@@ -890,11 +890,13 @@ static void cb_es_flush(struct flb_event_chunk *event_chunk,
890
flb_http_basic_auth(c, ctx->cloud_user, ctx->cloud_passwd);
891
}
892
else if (ctx->http_api_key) {
893
- header_line = flb_sds_printf(NULL, "ApiKey %s", ctx->http_api_key);
+ /* 7 for ApiKey + space */
894
+ header_line = flb_sds_create_size(strlen(ctx->http_api_key)+7);
895
if (header_line == NULL) {
896
flb_plg_error(ctx->ins, "failed to format API key auth header");
897
goto retry;
898
899
+ header_line = flb_sds_printf(&header_line, "ApiKey %s", ctx->http_api_key);
900
901
if (flb_http_add_header(c,
902
FLB_HTTP_HEADER_AUTH, strlen(FLB_HTTP_HEADER_AUTH),
0 commit comments