summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r--chrome/browser/sync/glue/http_bridge.h9
-rw-r--r--chrome/browser/sync/glue/http_bridge_unittest.cc6
2 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/sync/glue/http_bridge.h b/chrome/browser/sync/glue/http_bridge.h
index bb2af84..b2f4cbf 100644
--- a/chrome/browser/sync/glue/http_bridge.h
+++ b/chrome/browser/sync/glue/http_bridge.h
@@ -63,7 +63,9 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>,
}
virtual bool AllowSendingCookies(const URLRequest* request) const {
- return false; // Never send cookies.
+ // TODO(chron): http://crbug.com/20182. Change this to return false once
+ // all clients use Authenticate: header auth mode.
+ return true;
}
private:
@@ -83,6 +85,11 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>,
const char* content);
virtual void AddCookieForRequest(const char* cookie);
virtual bool MakeSynchronousPost(int* os_error_code, int* response_code);
+
+ // WARNING: these response content methods are used to extract plain old data
+ // and not null terminated strings, so you should make sure you have read
+ // GetResponseContentLength() characters when using GetResponseContent. e.g
+ // string r(b->GetResponseContent(), b->GetResponseContentLength()).
virtual int GetResponseContentLength() const;
virtual const char* GetResponseContent() const;
virtual int GetResponseCookieCount() const;
diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc
index 6b585f4..b817a49 100644
--- a/chrome/browser/sync/glue/http_bridge_unittest.cc
+++ b/chrome/browser/sync/glue/http_bridge_unittest.cc
@@ -158,8 +158,12 @@ TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveComprehensive) {
EXPECT_EQ(0, http_bridge->GetResponseCookieCount());
std::string response(http_bridge->GetResponseContent(),
http_bridge->GetResponseContentLength());
-
+#if BUG_20182_FIXED
+ // TODO(chron): Re-enable this expectation.
EXPECT_EQ(std::string::npos, response.find("Cookie:"));
+#else
+ EXPECT_NE(std::string::npos, response.find("Cookie:"));
+#endif
EXPECT_NE(std::string::npos, response.find("User-Agent: bob"));
EXPECT_NE(std::string::npos, response.find(test_payload.c_str()));
}