Skip to content

Commit 5779614

Browse files
committed
make header exactly the size needed
Signed-off-by: Gil Raphaelli <[email protected]>
1 parent eb74bd8 commit 5779614

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/out_es/es.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,8 @@ static void cb_es_flush(struct flb_event_chunk *event_chunk,
890890
flb_http_basic_auth(c, ctx->cloud_user, ctx->cloud_passwd);
891891
}
892892
else if (ctx->http_api_key) {
893-
header_line = flb_sds_create_size(48);
893+
// 7 for ApiKey + space
894+
header_line = flb_sds_create_size(strlen(ctx->http_api_key)+7);
894895
if (header_line == NULL) {
895896
flb_plg_error(ctx->ins, "failed to format API key auth header");
896897
goto retry;

0 commit comments

Comments
 (0)