Cookie response headers not shown when inspecting headless browser |
||||
Issue descriptionWhat steps will reproduce the problem? (1) python3 cookie.py (2) google-chrome --headless --remote-debugging-port=9222 http://localhost:8000 (3) Navigate to localhost:9222 and click on the inspector link. (4) Open the network pane, reload the page and click on the "localhost" resource. "Set-Cookie" should be listed in the results but it isn't. See the screenshots. Maybe we're missing some DevTools instrumentation for this?
,
Feb 27 2017
Additionally, it seems that the Cookie header isn't exposed either, and other headers like Accept, Accept-Encoding, Cache-Control, Connection, Host are missing as well from requests.
,
May 15 2017
,
Jul 4 2017
I don't know why dev people decided to hide those headers. It's don't seems reasonable to me. Please expose Cookie headers. In fact, please expose all headers, don't hide them. Thank you.
,
Jul 5 2017
Sami, you need to make sure the https://cs.chromium.org/chromium/src/content/common/resource_request.h?sq=package:chromium&l=182 is not lost. It controls raw header and timing being populated. https://cs.chromium.org/chromium/src/content/child/web_url_loader_impl.cc?dr=CSs&l=120 Over to Alex in case it is easily fixable.
,
Jul 6 2017
Thanks for the tip! I'm not sure where that would be getting lost since content should set it automatically when the inspector is open (i.e., network domain is enabled). We'll investigate...
,
Jul 7 2017
I wonder if this is something to do with the net::URLRequestContext HeadlessURLRequestContextGetter.
,
Jul 7 2017
I've reproduced this experimentally, it seems the Network.responseReceived doesn't contain the headers as expected. I'll try and dig into what is going wrong here.
,
Jul 10 2017
Strangely I can see that with --headless the ResourceResoonse data is going by the legacy IPC system and without it it's going via mojo. We should find out why that is (maybe a finch trial?)
,
Jul 10 2017
I believe I understand why cookies don't show up with --headless set. The reason is by default with --headless there is no NetLog. That matters because Set-Cookie headers are not usually sent to the Renderer (possibly for security reasons?) and DevTools relies on a sidechannel populated from NetLogData to obtain the full response headers. Setting a --log-net-log=SomeFile would fix this, except HeadlessContentBrowserClient doesn't override GetNetLog, which it should.
,
Jul 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b5b0b46b006dc1d26287f07e4d0d03a272037112 commit b5b0b46b006dc1d26287f07e4d0d03a272037112 Author: Alex Clarke <alexclarke@chromium.org> Date: Mon Jul 10 14:32:42 2017 Headless: Wire up a basic NetLog if we're not logging to disk DevTools relies on a NetLogObserver (which needs a NetLog) to return the raw response headers, e.g. Set-Cookie headers. Bug: 692090 Change-Id: I9faae71198b7c45d1dc05175b606452012d7ec83 Reviewed-on: https://chromium-review.googlesource.com/565139 Commit-Queue: Alex Clarke <alexclarke@chromium.org> Reviewed-by: Eric Seckler <eseckler@chromium.org> Cr-Commit-Position: refs/heads/master@{#485265} [modify] https://crrev.com/b5b0b46b006dc1d26287f07e4d0d03a272037112/headless/lib/browser/headless_browser_main_parts.cc [modify] https://crrev.com/b5b0b46b006dc1d26287f07e4d0d03a272037112/headless/lib/browser/headless_browser_main_parts.h [modify] https://crrev.com/b5b0b46b006dc1d26287f07e4d0d03a272037112/headless/lib/browser/headless_content_browser_client.cc [modify] https://crrev.com/b5b0b46b006dc1d26287f07e4d0d03a272037112/headless/lib/browser/headless_content_browser_client.h [modify] https://crrev.com/b5b0b46b006dc1d26287f07e4d0d03a272037112/headless/lib/headless_devtools_client_browsertest.cc
,
Jul 10 2017
,
Jul 10 2017
https://www.chromium.org/developers/design-documents/network-stack/netlog > Non-Goals > > NetLog is intended solely for logging. > > Features needing reliable network information should never be built on top of NetLog. > It may be tempting to add an observer of NetLog as a quick hack to glean some internal > state (since you circumvent having to create a proper interface and plumb it > deep into the network stack). But that is wrong, and it will break. Instead, you should > add an interface to NetworkDelegate, complete with regression tests and > documentation.
,
Sep 13 2017
Can anyone confirm that this started working properly for them? I am still experiencing this issue. |
||||
►
Sign in to add a comment |
||||
Comment 1 by potoms....@gmail.com
, Feb 14 2017