winhttp(11/13): Allow full path in addition to relative path in headers to accomodate proxy servers

Juan Lang juan.lang at gmail.com
Tue Jul 14 15:24:11 CDT 2009


--Juan
-------------- next part --------------
From 2368181ea3eabaa733a7fce4be61ec944c646899 Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Tue, 14 Jul 2009 13:04:20 -0700
Subject: [PATCH 11/13] Allow full path in addition to relative path in headers to accomodate proxy servers

---
 dlls/winhttp/tests/winhttp.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c
index 5a1db48..78c4777 100644
--- a/dlls/winhttp/tests/winhttp.c
+++ b/dlls/winhttp/tests/winhttp.c
@@ -343,6 +343,8 @@ static void test_WinHttpAddHeaders(void)
 
     static const WCHAR test_header_begin[] =
         {'P','O','S','T',' ','/','p','o','s','t','t','e','s','t','.','p','h','p',' ','H','T','T','P','/','1'};
+    static const WCHAR full_path_test_header_begin[] =
+        {'P','O','S','T',' ','h','t','t','p',':','/','/','c','r','o','s','s','o','v','e','r','.','c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',':','8','0','/','p','o','s','t','t','e','s','t','.','p','h','p',' ','H','T','T','P','/','1'};
     static const WCHAR test_header_end[] = {'\r','\n','\r','\n',0};
     static const WCHAR test_header_name[] = {'W','a','r','n','i','n','g',0};
 
@@ -476,7 +478,8 @@ static void test_WinHttpAddHeaders(void)
     ok(len + sizeof(WCHAR) <= oldlen, "WinHttpQueryHeaders resulting length longer than advertized.\n");
     ok((len < sizeof(buffer) - sizeof(WCHAR)) && buffer[len / sizeof(WCHAR)] == 0, "WinHttpQueryHeaders did not append NULL terminator\n");
     ok(len == lstrlenW(buffer) * sizeof(WCHAR), "WinHttpQueryHeaders returned incorrect length.\n");
-    ok(memcmp(buffer, test_header_begin, sizeof(test_header_begin)) == 0,
+    ok(memcmp(buffer, test_header_begin, sizeof(test_header_begin)) == 0 ||
+        memcmp(buffer, full_path_test_header_begin, sizeof(full_path_test_header_begin)) == 0,
         "WinHttpQueryHeaders returned invalid beginning of header string.\n");
     ok(memcmp(buffer + lstrlenW(buffer) - 4, test_header_end, sizeof(test_header_end)) == 0,
         "WinHttpQueryHeaders returned invalid end of header string.\n");
@@ -503,7 +506,9 @@ static void test_WinHttpAddHeaders(void)
     ok(len + sizeof(WCHAR) <= oldlen, "resulting length longer than advertized\n");
     ok((len < sizeof(buffer) - sizeof(WCHAR)) && !buffer[len / sizeof(WCHAR)] && !buffer[len / sizeof(WCHAR) - 1],
         "no double NULL terminator\n");
-    ok(!memcmp(buffer, test_header_begin, sizeof(test_header_begin)), "invalid beginning of header string\n");
+    ok(memcmp(buffer, test_header_begin, sizeof(test_header_begin)) == 0 ||
+        memcmp(buffer, full_path_test_header_begin, sizeof(full_path_test_header_begin)) == 0,
+        "invalid beginning of header string.\n");
     ok(index == 0, "header index was incremented\n");
 
     /* tests for more indices */
-- 
1.6.3.2


More information about the wine-patches mailing list