aboutsummaryrefslogtreecommitdiff
path: root/t/lib-httpd.sh
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2013-01-31 13:02:07 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-04 10:22:36 -0800
commit4656bf47fca857df51b5d6f4b7b052192b3b2317 (patch)
tree91e4d6cf951f2964de99d454ec89e426753ac453 /t/lib-httpd.sh
parente1b6ff44d61bcdd91280c3f7c3c5ace32d4b7c52 (diff)
downloadgit-4656bf47fca857df51b5d6f4b7b052192b3b2317.tar.gz
git-4656bf47fca857df51b5d6f4b7b052192b3b2317.tar.xz
Verify Content-Type from smart HTTP servers
Before parsing a suspected smart-HTTP response verify the returned Content-Type matches the standard. This protects a client from attempting to process a payload that smells like a smart-HTTP server response. JGit has been doing this check on all responses since the dawn of time. I mistakenly failed to include it in git-core when smart HTTP was introduced. At the time I didn't know how to get the Content-Type from libcurl. I punted, meant to circle back and fix this, and just plain forgot about it. Signed-off-by: Shawn Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-httpd.sh')
-rw-r--r--t/lib-httpd.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 02f442bfa..895b9258b 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -80,6 +80,7 @@ fi
prepare_httpd() {
mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH"
+ cp "$TEST_PATH"/broken-smart-http.sh "$HTTPD_ROOT_PATH"
ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules"