diff --git a/be-http.c b/be-http.c index afb40638..8095effc 100644 --- a/be-http.c +++ b/be-http.c @@ -132,7 +132,8 @@ static int http_post(void *handle, char *uri, const char *clientid, const char * return BACKEND_ERROR; } - snprintf(url, sizeof(url), "%s://%s:%d/%s", + // uri begins with a slash + snprintf(url, sizeof(url), "%s://%s:%d%s", strcmp(conf->with_tls, "true") == 0 ? "https" : "http", conf->hostname ? conf->hostname : "127.0.0.1", conf->port, diff --git a/be-jwt.c b/be-jwt.c index 147b6020..fb87f440 100644 --- a/be-jwt.c +++ b/be-jwt.c @@ -122,7 +122,8 @@ static int http_post(void *handle, char *uri, const char *clientid, const char * //_log(LOG_NOTICE, "u=%s p=%s t=%s acc=%d", username, password, topic, acc); - snprintf(url, sizeof(url), "%s://%s:%d/%s", + // uri begins with a slash + snprintf(url, sizeof(url), "%s://%s:%d%s", strcmp(conf->with_tls, "true") == 0 ? "https" : "http", conf->hostname ? conf->hostname : conf->ip, conf->port,