Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: third_party/WebKit/Source/core/loader/FormSubmission.cpp

Issue 1964303003: UPGRADE: Correctly handle navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forms. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/FormSubmission.cpp
diff --git a/third_party/WebKit/Source/core/loader/FormSubmission.cpp b/third_party/WebKit/Source/core/loader/FormSubmission.cpp
index 1ba1c83e2ad0969ee0b394880e008a4c59965fe4..d42aa99cf42c28b4c3a12800d221fe9ab8233c70 100644
--- a/third_party/WebKit/Source/core/loader/FormSubmission.cpp
+++ b/third_party/WebKit/Source/core/loader/FormSubmission.cpp
@@ -34,6 +34,7 @@
#include "core/InputTypeNames.h"
#include "core/dom/Document.h"
#include "core/events/Event.h"
+#include "core/frame/UseCounter.h"
#include "core/html/FormData.h"
#include "core/html/HTMLFormControlElement.h"
#include "core/html/HTMLFormElement.h"
@@ -196,6 +197,14 @@ FormSubmission* FormSubmission::create(HTMLFormElement* form, const Attributes&
Document& document = form->document();
KURL actionURL = document.completeURL(copiedAttributes.action().isEmpty() ? document.url().getString() : copiedAttributes.action());
+
+ if (document.getInsecureRequestsPolicy() == SecurityContext::InsecureRequestsUpgrade && actionURL.protocolIs("http")) {
+ UseCounter::count(document, UseCounter::UpgradeInsecureRequestsUpgradedRequest);
+ actionURL.setProtocol("https");
+ if (actionURL.port() == 80)
+ actionURL.setPort(443);
+ }
+
bool isMailtoForm = actionURL.protocolIs("mailto");
bool isMultiPartForm = false;
AtomicString encodingType = copiedAttributes.encodingType();
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormElement.cpp ('k') | third_party/WebKit/Source/core/loader/FrameFetchContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698