From 55bf8b4f06844a5d37b647cc6f0aa3769f620548 Mon Sep 17 00:00:00 2001 From: "kaie%netscape.com" Date: Mon, 15 Jul 2002 13:37:22 +0000 Subject: [PATCH] b=151250 False warning posting to https site from http site. r=javi sr=alecf a=asa git-svn-id: svn://10.0.0.236/trunk@125210 18797224-902f-48f8-a5cc-f745e15eee43 --- .../boot/src/nsSecureBrowserUIImpl.cpp | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/mozilla/security/manager/boot/src/nsSecureBrowserUIImpl.cpp b/mozilla/security/manager/boot/src/nsSecureBrowserUIImpl.cpp index ff1bf87d688..dce8375f1a0 100644 --- a/mozilla/security/manager/boot/src/nsSecureBrowserUIImpl.cpp +++ b/mozilla/security/manager/boot/src/nsSecureBrowserUIImpl.cpp @@ -1174,19 +1174,8 @@ nsSecureBrowserUIImpl::IsURLHTTPS(nsIURI* aURL, PRBool* value) if (!aURL) return NS_OK; - - nsCAutoString scheme; - aURL->GetScheme(scheme); - // If no scheme, it's not an https url - not necessarily an error. - // See bugs 54845 and 54966 - if (scheme.IsEmpty()) - return NS_OK; - - if (!PL_strncasecmp(scheme.get(), "https", 5)) - *value = PR_TRUE; - - return NS_OK; + return aURL->SchemeIs("https", value); } void @@ -1222,13 +1211,15 @@ nsSecureBrowserUIImpl::CheckPost(nsIURI *formURL, nsIURI *actionURL, PRBool *oka if (NS_FAILED(rv)) return rv; - // if we are posting to a secure link from a secure page, all is okay. - if (actionSecure && formSecure) { + // If we are posting to a secure link, all is okay. + // It doesn't matter whether the currently viewed page is secure or not, + // because the data will be sent to a secure URL. + if (actionSecure) { return NS_OK; } // posting to insecure webpage from a secure webpage. - if (!actionSecure && formSecure) { + if (formSecure) { *okayToPost = ConfirmPostToInsecureFromSecure(); } else { *okayToPost = ConfirmPostToInsecure();