summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3cf8fe1)
raw | patch | inline | side by side (parent: 3cf8fe1)
author | Gabriel Corona <gabriel.corona@enst-bretagne.fr> | |
Sun, 14 Nov 2010 01:51:15 +0000 (02:51 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 17 Nov 2010 21:07:43 +0000 (13:07 -0800) |
Change the authentification initialisation to percent-decode username
and password for HTTP URLs.
Signed-off-by: Gabriel Corona <gabriel.corona@enst-bretagne.fr>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
and password for HTTP URLs.
Signed-off-by: Gabriel Corona <gabriel.corona@enst-bretagne.fr>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c | patch | blob | history | |
t/t5550-http-fetch.sh | patch | blob | history |
index 0a5011f615bdfade0b69682b177dc97471ac20a3..c9393a84715aa543938b9c4f934186334486daae 100644 (file)
--- a/http.c
+++ b/http.c
#include "pack.h"
#include "sideband.h"
#include "run-command.h"
+#include "url.h"
int data_received;
int active_requests;
static void http_auth_init(const char *url)
{
- char *at, *colon, *cp, *slash;
+ char *at, *colon, *cp, *slash, *decoded;
int len;
cp = strstr(url, "://");
user_name = xmalloc(len + 1);
memcpy(user_name, cp, len);
user_name[len] = '\0';
+ decoded = url_decode(user_name);
+ free(user_name);
+ user_name = decoded;
user_pass = NULL;
} else {
len = colon - cp;
user_name = xmalloc(len + 1);
memcpy(user_name, cp, len);
user_name[len] = '\0';
+ decoded = url_decode(user_name);
+ free(user_name);
+ user_name = decoded;
len = at - (colon + 1);
user_pass = xmalloc(len + 1);
memcpy(user_pass, colon + 1, len);
user_pass[len] = '\0';
+ decoded = url_decode(user_pass);
+ free(user_pass);
+ user_pass = decoded;
}
}
diff --git a/t/t5550-http-fetch.sh b/t/t5550-http-fetch.sh
index a0564deaae754c47a614a162ed2df27e20edf976..8c2ac353b7736c4bce7ed71333284863d9c4e514 100755 (executable)
--- a/t/t5550-http-fetch.sh
+++ b/t/t5550-http-fetch.sh
test_cmp file clone/file
'
-test_expect_failure 'clone http repository with authentication' '
+test_expect_success 'clone http repository with authentication' '
mkdir "$HTTPD_DOCUMENT_ROOT_PATH/auth/" &&
cp -Rf "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" "$HTTPD_DOCUMENT_ROOT_PATH/auth/repo.git" &&
git clone $AUTH_HTTPD_URL/auth/repo.git clone-auth &&