[epiphany/mcatanzaro/password-form-missing-action: 8/8] Fix type error when form doesn't have an action



commit 4c2dd075722f2ab22e5ccee724f749fc95b7369b
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Jul 5 16:15:06 2019 -0500

    Fix type error when form doesn't have an action
    
    In this case, we assume the form is secure. The page is going to do
    something with the form result manually, and there's no way to know
    what.

 embed/web-process-extension/resources/js/ephy.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/embed/web-process-extension/resources/js/ephy.js 
b/embed/web-process-extension/resources/js/ephy.js
index 440cdf3ac..f33228b9a 100644
--- a/embed/web-process-extension/resources/js/ephy.js
+++ b/embed/web-process-extension/resources/js/ephy.js
@@ -562,9 +562,12 @@ Ephy.FormManager = class FormManager
 
     _passwordFormFocused(event)
     {
-        let url = new URL(this._form.action);
-        // Warning: we do not whitelist localhost because it could be redirected by DNS.
-        let isInsecureAction = url.protocol == 'http:' && url.hostname != "127.0.0.1" && url.hostname != 
"::1";
+        let isInsecureAction = false;
+        if (this._form.action) {
+            let url = new URL(this._form.action);
+            // Warning: we do not whitelist localhost because it could be redirected by DNS.
+            isInsecureAction = url.protocol == 'http:' && url.hostname != "127.0.0.1" && url.hostname != 
"::1";
+        }
         
window.webkit.messageHandlers.passwordFormFocused.postMessage(this._passwordFormMessageSerializer(this._frameID,
 isInsecureAction));
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]