|
Fix problems with cross-origin redirects.
Three problems exist in the current code:
1) If a same-origin request causes a redirect to a different origin,
do not enforce access control checks for the redirect response
itself, because the request which resulted in the redirect was
same-origin.
2) If a same-origin request causes a redirect to a different origin,
use the original request's URL as the origin for the new request;
do not use a unique security origin.
3) Track whether the client (i.e., XMLHttpRequest) actually requested
that credentials be sent in the first place. When a same-origin
request redirects to a different origin, the original request will
send cookies whether requested or not, because it is same-origin.
The new cross-origin request should not send cookies unless they
were requested, so that the access control checks on the response
will succeed if the server granted "Access-Control-Allow-Origin=*".
BUG= 226897
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=150130
Total comments: 6
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+203 lines, -61 lines) |
Patch |
|
M |
LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects.html
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async.html
|
View
|
1
2
|
2 chunks |
+18 lines, -32 lines |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt
|
View
|
1
|
1 chunk |
+7 lines, -16 lines |
0 comments
|
Download
|
|
A |
LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-same-origin.html
|
View
|
1
|
1 chunk |
+88 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-same-origin-expected.txt
|
View
|
1
|
1 chunk |
+27 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt
|
View
|
1
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-2-expected.txt
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-expected.txt
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-post-expected.txt
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt
|
View
|
1
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/xmlhttprequest/resources/access-control-basic-allow-no-credentials.cgi
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/loader/DocumentLoader.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/loader/DocumentThreadableLoader.cpp
|
View
|
1
|
3 chunks |
+12 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/core/loader/ResourceLoaderOptions.h
|
View
|
1
|
2 chunks |
+19 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/loader/cache/CachedResourceLoader.cpp
|
View
|
1
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/page/EventSource.cpp
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/platform/network/ResourceHandleTypes.h
|
View
|
1
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/xml/XMLHttpRequest.cpp
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
Total messages: 10 (0 generated)
|