request interception does not support intercepting on both request and response |
||
Issue descriptionAs per original reporter: I found if I set InterceptionStage to be both HEADER_RECEIVED and REQUEST, and load a page(a simple url without any redirect), OnRequestIntercepted can only get notified when about to send request, it will not get notified when headers is received. I think it is because after the request is first intercepted in REQUEST phrase, after we ContinueInterceptRequest, in DevtoolsURLInterceptorRequestJob::ProcessInterceptionResponse[3], you set waiting_for_user_response_ to be NOT_WAITING in any case, and when it is not redirect and it is not ack for response, you just reset the sub_request_ to be a new SubRequest, these are true if the InterceptionStage is just REQUEST or RESPONSE, but it is not true for both, for the case where InterceptionStage is BOTH, and if it is not redirect, also it is not ack for response, an InterceptedRequest should be reset to sub_request_ since we need to intercept it in RESPONSE phase too. [3] https://chromium.googlesource.com/chromium/src/+blame/ceddc5e2891bf27e49394e7fca0895c3ae2efd02/content/browser/devtools/devtools_url_interceptor_request_job.cc#1040
,
Apr 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9ae2e567db93944e37b0cc14b4cea90b30a8388d commit 9ae2e567db93944e37b0cc14b4cea90b30a8388d Author: Andrey Kosyakov <caseq@chromium.org> Date: Fri Apr 06 17:29:14 2018 DevTools: fix interception on both stages in old URLRequestJob-based impl Also fix request-response-interception-disable-between.js which only used to work because interception on both response and request did not. Bug: 829595 Change-Id: I6e00c6b5a56e512d24fedc6369462376dddcbe3e Reviewed-on: https://chromium-review.googlesource.com/999040 Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Commit-Queue: Andrey Kosyakov <caseq@chromium.org> Cr-Commit-Position: refs/heads/master@{#548840} [modify] https://crrev.com/9ae2e567db93944e37b0cc14b4cea90b30a8388d/content/browser/devtools/devtools_url_interceptor_request_job.cc [add] https://crrev.com/9ae2e567db93944e37b0cc14b4cea90b30a8388d/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/interception-on-both-expected.txt [add] https://crrev.com/9ae2e567db93944e37b0cc14b4cea90b30a8388d/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/interception-on-both.js [modify] https://crrev.com/9ae2e567db93944e37b0cc14b4cea90b30a8388d/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-response-interception-disable-between.js
,
Apr 6 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by caseq@chromium.org
, Apr 5 2018