Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/History.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/History.cpp b/third_party/WebKit/Source/core/frame/History.cpp |
| index 12d05442e572d7873a67bd7671ecd10920453509..efb4a0b130fc47a3ace7d04469560fa6c4ba0350 100644 |
| --- a/third_party/WebKit/Source/core/frame/History.cpp |
| +++ b/third_party/WebKit/Source/core/frame/History.cpp |
| @@ -168,9 +168,10 @@ void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str |
| return; |
| KURL fullURL = urlForState(urlString); |
| - if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest(fullURL)) { |
| + Document* document = m_frame->document(); |
| + if (!fullURL.isValid() || !document->securityOrigin()->areSamePageUrls(fullURL, document->url())) { |
|
Mike West
2015/12/08 13:45:19
If we need a special case for `pushState`/`replace
robwu
2015/12/08 14:06:39
Will do.
|
| // We can safely expose the URL to JavaScript, as a) no redirection takes place: JavaScript already had this URL, b) JavaScript can only access a same-origin History object. |
| - exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_frame->document()->securityOrigin()->toString() + "'."); |
| + exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + document->securityOrigin()->toString() + "' and URL '" + document->url().elidedString() + "'."); |
| return; |
| } |