Skip to content
This repository has been archived by the owner on Mar 12, 2019. It is now read-only.

Commit

Permalink
fix building uri
Browse files Browse the repository at this point in the history
	closes #381
  • Loading branch information
jpmens committed Nov 27, 2018
1 parent 9fe7b4e commit 537a822
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions be-http.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,11 @@ static int http_post(void *handle, char *uri, const char *clientid, const char *
return BACKEND_ERROR;
}

// enable the https
if (strcmp(conf->with_tls, "true") == 0){
sprintf(url, "https://%s:%d%s", conf->hostname, conf->port, uri);
}else{
sprintf(url, "http://%s:%d%s", conf->hostname, conf->port, uri);
}
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,
uri);

char* escaped_username = curl_easy_escape(curl, username, 0);
char* escaped_password = curl_easy_escape(curl, password, 0);
Expand Down

0 comments on commit 537a822

Please sign in to comment.