[tor-commits] [tor-browser] 40/43: Bug 1769572 - [devtools] The CONNECT method should no longer be sent on request resend. r=nchevobbe, a=RyanVM

gitolite role git at cupani.torproject.org
Tue May 31 07:07:23 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch tor-browser-91.10.0esr-11.0-1
in repository tor-browser.

commit 023da600ba89bf187212e3d1602ba3a59184ed16
Author: Hubert Boma Manilla <hmanilla at mozilla.com>
AuthorDate: Thu May 19 18:26:43 2022 +0000

    Bug 1769572 - [devtools] The CONNECT method should no longer be sent on request resend. r=nchevobbe, a=RyanVM
    
    The CONNECT method sent on Edit & Resend of certain requests crashes firefox
    based on https://bugzilla.mozilla.org/show_bug.cgi?id=1769572#c2, Necko uses CONNECT in a special way, so lets restrict
    the devtools from selecting and sending it.
    
    The crash happens with both the current and new edit and resend panels, so this patch
    needs to be tested for both.
    
    Use the devtools.netmonitor.features.newEditAndResend and set it to true to enable the new edit and resend panel.
    
    Note: The new edit and resend panel is enabled by default in Nightly.
    
    See https://bugzilla.mozilla.org/show_bug.cgi?id=1769572#c0 for the STR for the current Edit and Resend panel
    See https://bugzilla.mozilla.org/show_bug.cgi?id=1769572#c7 for the STR for the new Edit and Resend
---
 devtools/server/actors/network-monitor/network-content.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/devtools/server/actors/network-monitor/network-content.js b/devtools/server/actors/network-monitor/network-content.js
index d5f7e6b61155e..9e8812331a879 100644
--- a/devtools/server/actors/network-monitor/network-content.js
+++ b/devtools/server/actors/network-monitor/network-content.js
@@ -86,7 +86,13 @@ const NetworkContentActor = ActorClassWithSpec(networkContentSpec, {
       Ci.nsIRequest.INHIBIT_CACHING |
       Ci.nsIRequest.LOAD_ANONYMOUS;
 
+    if (method == "CONNECT") {
+      throw new Error(
+        "The CONNECT method is restricted and cannot be sent by devtools"
+      );
+    }
     channel.requestMethod = method;
+
     if (headers) {
       for (const { name, value } of headers) {
         if (name.toLowerCase() == "referer") {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list