summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome_frame/test/data/referrer_frame.html14
-rw-r--r--chrome_frame/urlmon_moniker.cc7
-rw-r--r--chrome_frame/urlmon_url_request.cc4
3 files changed, 11 insertions, 14 deletions
diff --git a/chrome_frame/test/data/referrer_frame.html b/chrome_frame/test/data/referrer_frame.html
index c987a3f..2927445 100644
--- a/chrome_frame/test/data/referrer_frame.html
+++ b/chrome_frame/test/data/referrer_frame.html
@@ -7,13 +7,15 @@
<script type="text/javascript">
function onLoad() {
- var referrer_search = /referrer_main.html/;
- var referrer_pos = document.referrer.search(referrer_search);
+ if (isRunningInChrome()) {
+ var referrer_search = /referrer_main.html/;
+ var referrer_pos = document.referrer.search(referrer_search);
- if (referrer_pos != -1) {
- onSuccess("FullTab_ReferrerTest", 1);
- } else {
- onFailure("FullTab_ReferrerTest", 1, "Failed to find referrer");
+ if (referrer_pos != -1) {
+ onSuccess("FullTab_ReferrerTest", 1);
+ } else {
+ onFailure("FullTab_ReferrerTest", 1, "Failed to find referrer");
+ }
}
}
</script>
diff --git a/chrome_frame/urlmon_moniker.cc b/chrome_frame/urlmon_moniker.cc
index 85fad9f..0873f13 100644
--- a/chrome_frame/urlmon_moniker.cc
+++ b/chrome_frame/urlmon_moniker.cc
@@ -33,11 +33,8 @@ std::string FindReferrerFromHeaders(const wchar_t* headers,
if (!both_headers[i])
continue;
std::string raw_headers_utf8 = WideToUTF8(both_headers[i]);
- std::string http_headers =
- net::HttpUtil::AssembleRawHeaders(raw_headers_utf8.c_str(),
- raw_headers_utf8.length());
- net::HttpUtil::HeadersIterator it(http_headers.begin(),
- http_headers.end(), "\r\n");
+ net::HttpUtil::HeadersIterator it(raw_headers_utf8.begin(),
+ raw_headers_utf8.end(), "\r\n");
while (it.GetNext()) {
if (LowerCaseEqualsASCII(it.name(), "referer")) {
referrer = it.values();
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index 6f1a123..96666a9 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -497,9 +497,7 @@ STDMETHODIMP UrlmonUrlRequest::OnResponse(DWORD dwResponseCode,
// NOTE(slightlyoff): We don't use net::HttpResponseHeaders here because
// of lingering ICU/base_noicu issues.
if (enable_frame_busting_) {
- std::string http_headers = net::HttpUtil::AssembleRawHeaders(
- raw_headers.c_str(), raw_headers.length());
- if (http_utils::HasFrameBustingHeader(http_headers)) {
+ if (http_utils::HasFrameBustingHeader(raw_headers)) {
DLOG(ERROR) << "X-Frame-Options header other than ALLOWALL " <<
"detected, navigation canceled";
return E_FAIL;