Merge branch 'jk/config-int-range-check'
[gitweb.git] / http.c
diff --git a/http.c b/http.c
index 2fbf986231d0e23b1d2c15c8d9121f1129139097..f3e1439d58a00328ece38a6eead63309fe7f58ca 100644 (file)
--- a/http.c
+++ b/http.c
@@ -3,6 +3,7 @@
 #include "sideband.h"
 #include "run-command.h"
 #include "url.h"
+#include "urlmatch.h"
 #include "credential.h"
 #include "version.h"
 #include "pkt-line.h"
@@ -161,8 +162,7 @@ static int http_options(const char *var, const char *value, void *cb)
        if (!strcmp("http.sslcainfo", var))
                return git_config_string(&ssl_cainfo, var, value);
        if (!strcmp("http.sslcertpasswordprotected", var)) {
-               if (git_config_bool(var, value))
-                       ssl_cert_password_required = 1;
+               ssl_cert_password_required = git_config_bool(var, value);
                return 0;
        }
        if (!strcmp("http.ssltry", var)) {
@@ -346,10 +346,20 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
 {
        char *low_speed_limit;
        char *low_speed_time;
+       char *normalized_url;
+       struct urlmatch_config config = { STRING_LIST_INIT_DUP };
+
+       config.section = "http";
+       config.key = NULL;
+       config.collect_fn = http_options;
+       config.cascade_fn = git_default_config;
+       config.cb = NULL;
 
        http_is_verbose = 0;
+       normalized_url = url_normalize(url, &config.url);
 
-       git_config(http_options, NULL);
+       git_config(urlmatch_config_entry, &config);
+       free(normalized_url);
 
        curl_global_init(CURL_GLOBAL_ALL);