From 912b2acf2f376e51bee32a486ca42ba4ad764363 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Tue, 23 Jul 2013 15:40:17 -0700 Subject: http: add http.savecookies option to write out HTTP cookies HTTP servers may send Set-Cookie headers in a response and expect them to be set on subsequent requests. By default, libcurl behavior is to store such cookies in memory and reuse them across requests within a single session. However, it may also make sense, depending on the server and the cookies, to store them across sessions. Provide users an option to enable this behavior, writing cookies out to the same file specified in http.cookiefile. Signed-off-by: Dave Borowitz Signed-off-by: Junio C Hamano --- t/lib-httpd/apache.conf | 8 ++++++++ t/t5551-http-fetch.sh | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 't') diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf index dd17e3a09d..397c480401 100644 --- a/t/lib-httpd/apache.conf +++ b/t/lib-httpd/apache.conf @@ -22,6 +22,9 @@ ErrorLog error.log LoadModule version_module modules/mod_version.so + + LoadModule headers_module modules/mod_headers.so + LockFile accept.lock @@ -87,6 +90,11 @@ Alias /auth/dumb/ www/auth/dumb/ SetEnv GIT_HTTP_EXPORT_ALL SetEnv GIT_NAMESPACE ns + + SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} + SetEnv GIT_HTTP_EXPORT_ALL + Header set Set-Cookie name=value + ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1 ScriptAlias /broken_smart/ broken-smart-http.sh/ diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh index 55a866af80..287d22b510 100755 --- a/t/t5551-http-fetch.sh +++ b/t/t5551-http-fetch.sh @@ -187,6 +187,24 @@ test_expect_success 'dumb clone via http-backend respects namespace' ' test_cmp expect actual ' +cat >cookies.txt <expect_cookies.txt <