diff --git a/src/flb_http_common.c b/src/flb_http_common.c index 9b3f4d51737..b747a3a4895 100644 --- a/src/flb_http_common.c +++ b/src/flb_http_common.c @@ -519,14 +519,6 @@ int flb_http_request_set_url(struct flb_http_request *request, return -1; } - start_of_authority = strstr(local_url, "://"); - - if (start_of_authority == NULL) { - cfl_sds_destroy(local_url); - - return -1; - } - start_of_authorization = NULL; start_of_query_string = NULL; start_of_authority = NULL; @@ -536,6 +528,14 @@ int flb_http_request_set_url(struct flb_http_request *request, start_of_host = NULL; start_of_path = NULL; + start_of_authority = strstr(local_url, "://"); + + if (start_of_authority == NULL) { + cfl_sds_destroy(local_url); + + return -1; + } + start_of_authority = &start_of_authority[3]; start_of_path = strstr(start_of_authority, "/");