summaryrefslogtreecommitdiffstats
path: root/chrome_frame/urlmon_url_request.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-27 18:29:43 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-27 18:29:43 +0000
commit13e042909448bfe09c740eb2935be9f007ceb7f4 (patch)
tree225c512ded24dff3c59b57947a0464151e50a86c /chrome_frame/urlmon_url_request.cc
parent7568a1714cdbf3cf9cced51496f7d3b53738d524 (diff)
downloadchromium_src-13e042909448bfe09c740eb2935be9f007ceb7f4.zip
chromium_src-13e042909448bfe09c740eb2935be9f007ceb7f4.tar.gz
chromium_src-13e042909448bfe09c740eb2935be9f007ceb7f4.tar.bz2
Pass Chrome's UA with chromeframe appended at the end in the user agent passed in ChromeFrame
requests initiated in IE. Fixes bug http://b/issue?id=3022937 Bug=3022937 Review URL: http://codereview.chromium.org/4202003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64102 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request.cc')
-rw-r--r--chrome_frame/urlmon_url_request.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index 7015f8f..c77df46 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -585,12 +585,15 @@ STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url,
}
// In the rare case if "User-Agent" string is already in |current_headers|.
- if (IsGcfDefaultRenderer()) {
- new_headers += ReplaceOrAddUserAgent(current_headers,
- http_utils::GetChromeUserAgent());
- } else {
- new_headers += AppendCFUserAgentString(current_headers, NULL);
- }
+ // We send Chrome's user agent in requests initiated within ChromeFrame to
+ // enable third party content in pages rendered in ChromeFrame to correctly
+ // send content for Chrome as the third party content may not be equipped to
+ // identify chromeframe as the user agent. This also ensures that the user
+ // agent reported in scripts in chrome frame is consistent with that sent
+ // in outgoing requests.
+ new_headers += ReplaceOrAddUserAgent(current_headers,
+ http_utils::GetChromeUserAgent());
+ new_headers += AppendCFUserAgentString(UTF8ToWide(new_headers).c_str(), NULL);
if (!new_headers.empty()) {
*additional_headers = reinterpret_cast<wchar_t*>(