Closed Bug 1803531 Opened 3 years ago Closed 1 year ago

Blocked request is sent regardless

Categories

(DevTools :: Netmonitor, defect, P3)

Firefox 108
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1756770

People

(Reporter: richard+bugzilla, Unassigned)

References

Details

Attachments

(3 files)

Attached image firefox-bug.png

Steps to reproduce:

I added a request to the request block list in the developer tools.

Actual results:

The request is shown as blocked in the request list. However, the request is still dispatched to the server. This only happens in some cases. In most cases it works and the request is blocked. Each request is shown as blocked in the request list, regardless if it's blocked or not.

The requests in question are triggered by JS via XHR.

Expected results:

All requests to the blocked url should be blocked and never sent.

Version: Mozilla Firefox 108.0b7 (64 bit) (Developer Edition)

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Networking' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Networking
Product: Firefox → Core

Lightly tested with a "random" website on Nightly 109, linux. Unable to reproduce after blocking with both GET and PUT and requesting via console with: xhr.open('PUT', '<page-path>'); xhr.send();

  1. Can you submit some http logs to necko@mozilla.com?
  2. Does this only happen with .ics PUTs?
  3. Does this only happen on localhost?
  4. How are you making the duplicate requests exactly?
Flags: needinfo?(richard+bugzilla)

I think this is a devtool bug.
We don't need the http log, but it'd be good to provide us a reliable way to reproduce this. Thanks.

Component: DOM: Networking → Netmonitor
Product: Core → DevTools

I attached a simple Python3 web server with some javascript to send XHR request. The bug can be reproduced very reliably using this setup. Run it via python3 ./server.py, open http://localhost:8080 in Firefox and block requests to http://localhost:8080/ping in the DevTools.

I was able to reproduce the bug 100% of times during my initial testing. It does not seem to be related to .ics PUTs.

Please let me know if you need further information about my repro code or the bug in general.

How does it work?

  • Browser sends a XHR request to /ping once every second.
  • Server logs the request to stdout and responds with "pong".
  • Client logs the response to the browser console and also appends an element to body with a timestamp.

Expected behavior

  • The web server should not log any incoming request because they are blocked.
  • The browser console should not log any incoming responses because the requests shouldn't be send in the first place (hence no responses).

Actual behavior

  • The network logs in DevTools shows that requests are blocked.
  • The server logs incoming requests but errors on writing a response.
  • The browser console does not log incoming responses and no elements are appended to the html body.
  • => This indicates that requests are not blocked by DevTools. However, it seems that responses are blocked instead. They aren't read and the connection is closed.

Error logged by the server:

127.0.0.1 - - [03/Dec/2022 11:47:59] "GET /ping HTTP/1.1" 200 -
----------------------------------------
Exception occurred during processing of request from ('127.0.0.1', 33970)
Traceback (most recent call last):
  File "/usr/lib/python3.10/socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.10/socketserver.py", line 347, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.10/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.10/socketserver.py", line 747, in __init__
    self.handle()
  File "/usr/lib/python3.10/http/server.py", line 432, in handle
    self.handle_one_request()
  File "/usr/lib/python3.10/http/server.py", line 420, in handle_one_request
    method()
  File "/home/richard/Code/firefox-bug-repro/./server.py", line 23, in do_GET
    self.wfile.write(b'pong')
  File "/usr/lib/python3.10/socketserver.py", line 826, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
Flags: needinfo?(richard+bugzilla)

The bug is also reproducible on Firefox Nightly.

$ ./firefox --full-version
Mozilla Firefox 109.0a1 20221202212633 20221202212633
Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1756770

Thanks for the STR.
I could reproduce the issue. It looks like its related to Bug 1756770.
Lets keep and test both STR when fixed.

Severity: -- → S3
Priority: -- → P3

Hi Richard,

We recently landed a fix for this on Nightly, via Bug 1756770. Can you check if it fixed your problem?

Thanks!

Flags: needinfo?(richard+bugzilla)

I just tested Firefox Nightly 129.0a1 (2024-06-19) (64-Bit) and the issue is fixed in this version.

Thanks for tackling this bug :)

Flags: needinfo?(richard+bugzilla)

Thanks a lot for checking! Let's close this bug then :)

Status: NEW → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1756770
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: