summaryrefslogtreecommitdiffstats
path: root/media/blink/buffered_data_source.cc
diff options
context:
space:
mode:
authordalecurtis <dalecurtis@chromium.org>2015-10-21 17:26:26 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-22 00:27:07 +0000
commite11ea5ed677321f5fa24e8e77b01f8f57a0098a5 (patch)
tree72589ff802134979742c03949110293954eee288 /media/blink/buffered_data_source.cc
parent34a8990806a42ee9356ce5b2f932057169c03a90 (diff)
downloadchromium_src-e11ea5ed677321f5fa24e8e77b01f8f57a0098a5.zip
chromium_src-e11ea5ed677321f5fa24e8e77b01f8f57a0098a5.tar.gz
chromium_src-e11ea5ed677321f5fa24e8e77b01f8f57a0098a5.tar.bz2
Relax cross-origin partial response requirements for CORS presence.
Per discussion on the bug, if the redirect passes a CORS we should allow the mixing of origins. DidPassCORSAccessCheck() will ensure each request passes the crossorigin test. Prior to this fix, crossOrigin redirects for video were always broken, this fix also allows 'range' to be a simple header when a client has requested no preflight. BUG=532569 TEST=new unittest, manually verified exploit fails if crossorigin set. Review URL: https://codereview.chromium.org/1356353003 Cr-Commit-Position: refs/heads/master@{#355452}
Diffstat (limited to 'media/blink/buffered_data_source.cc')
-rw-r--r--media/blink/buffered_data_source.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/media/blink/buffered_data_source.cc b/media/blink/buffered_data_source.cc
index eb4c984..0fc1617 100644
--- a/media/blink/buffered_data_source.cc
+++ b/media/blink/buffered_data_source.cc
@@ -431,9 +431,10 @@ bool BufferedDataSource::CheckPartialResponseURL(
// generated bytes and the target response. See http://crbug.com/489060#c32
// for details.
// If the origin of the new response is different from the first response we
- // deny the redirected response.
- return response_original_url_.GetOrigin() ==
- partial_response_original_url.GetOrigin();
+ // deny the redirected response unless the crossorigin attribute has been set.
+ return (response_original_url_.GetOrigin() ==
+ partial_response_original_url.GetOrigin()) ||
+ DidPassCORSAccessCheck();
}
void BufferedDataSource::ReadCallback(