瀏覽代碼

LibWeb: Include cookies in form submission

Services expect cookies to be submitted with forms, especially login
screens.

Allows us to sign in to GitHub (including two factor authentication)
and start using it!
Luke Wilde 3 年之前
父節點
當前提交
b59773de17
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp

+ 1 - 2
Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp

@@ -116,8 +116,7 @@ void HTMLFormElement::submit_form(RefPtr<HTMLElement> submitter, bool from_submi
         url.set_query(url_encode(parameters, AK::URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded));
     }
 
-    LoadRequest request;
-    request.set_url(url);
+    LoadRequest request = LoadRequest::create_for_url_on_page(url, document().page());
 
     if (effective_method == "post") {
         auto body = url_encode(parameters, AK::URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded).to_byte_buffer();