Calling Request.clone() stops Chrome network tools from being able to read request payload
Reported by
maa...@glikm.com,
Mar 3 2017
|
|||||||||||
Issue descriptionChrome Version : 56.0.2924.87 URLs (if applicable) : http://www.glikm.com/fetch.html Other browsers tested: Safari: OK (Technology Preview) Firefox: OK (51.0.1) What steps will reproduce the problem? (1) Create a Request object with post data e.g (2) Clone the request using request.clone() (3) Fire the request using fetch with the original request object (not the cloned one) What is the expected result? Network tools inspector should display the request payload. What happens instead? Network tools inspector displays the request without a request payload. Please see a test case in the provided URL.
,
Mar 3 2017
,
Mar 6 2017
Tested the issue on Windows-7, Mac-10.12.2 and Linux Ubuntu-14.04 using chrome stable version 56.0.2924.87 and canary 59.0.3030.0 with below steps. 1.Opened Chrome and navigated to http://www.glikm.com/fetch.html 2.Opened devtools and clicked on Network tab and clicked on Fire request with clone, not observed the request payload. 3.And clicked on Fire request without clone and observed the request payload in devtools. Please find the attached screen cast and let us know if anything missed here to reproduce the issue. Thank you..
,
Mar 6 2017
Screencast matches my issue. Thanks
,
Mar 6 2017
Thank you for providing more feedback. Adding requester "sureshkumari@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 8 2017
maayan@, Could you please confirm the below points to proceed further. 1. On which OS you are able to reproduce the issue? 2. 'Request payload' should be displayed for both I.Fire request with clone II.Fire request without clone Note:Observed 'Request payload' is not displayed for I & II in firefox. Thanks in advance!!
,
Mar 8 2017
1. OS X (10.11.3) but as the video made by sureshkumari shows it also happens on windows 7. 2. Yes, Request Payload should be displayed for both. I can see Request Payload showing in Firefox on both requests, their Params Tab is just a bit misleading (have to click on an empty space to see it, see attached video).
,
Mar 8 2017
Thank you for providing more feedback. Adding requester "jmukthavaram@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 9 2017
Able to reproduce the issue on windows 7, Ubuntu 14.04 and Mac 10.12.3 using chrome version 56.0.2924.87 and canary 59.0.3035.0. This issue is reproducible upto M45.In M45 not able to see the request payload for both request. From M40 and prior versions not able to see the Requests under network panel. Marking it as Untriaged to get more inputs from dev. Thanks,
,
Mar 17 2017
,
Oct 2 2017
,
Dec 13 2017
,
Dec 13 2017
,
Dec 18 2017
clone() suppresses request body reporting both for the original request and for a clone.
In this example only r3 body is visible in the DevTools:
const r1 = new Request('/page?cloned', {method: 'post', body: 'There is one'});
const r2 = r1.clone();
const r3 = new Request('/page?notcloned', {method: 'post', body: 'There is another'});
await fetch(r1);
await fetch(r2);
await fetch(r3);
,
Jan 23 2018
,
Feb 9 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/95f7d22cfff65db8271ee240486238f7d204586b commit 95f7d22cfff65db8271ee240486238f7d204586b Author: Eugene Ostroukhov <eostroukhov@chromium.org> Date: Fri Feb 09 00:32:17 2018 DevTools: report request bodies if they are blobs Cloning request turns its body into blob so both instances can refer the same entity. DevTools need to properly handle such requests and report body contents. Bug: 698209 , 520538 Change-Id: I8c9e719da552d1b7b2371a5d199475b6abed971a Reviewed-on: https://chromium-review.googlesource.com/833344 Commit-Queue: Eugene Ostroukhov <eostroukhov@chromium.org> Reviewed-by: Andrey Kosyakov <caseq@chromium.org> Cr-Commit-Position: refs/heads/master@{#535592} [add] https://crrev.com/95f7d22cfff65db8271ee240486238f7d204586b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/get-request-blob-data-expected.txt [add] https://crrev.com/95f7d22cfff65db8271ee240486238f7d204586b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/get-request-blob-data.js [modify] https://crrev.com/95f7d22cfff65db8271ee240486238f7d204586b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp [modify] https://crrev.com/95f7d22cfff65db8271ee240486238f7d204586b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h [modify] https://crrev.com/95f7d22cfff65db8271ee240486238f7d204586b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp [modify] https://crrev.com/95f7d22cfff65db8271ee240486238f7d204586b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.h [modify] https://crrev.com/95f7d22cfff65db8271ee240486238f7d204586b/third_party/WebKit/Source/core/inspector/inspector_protocol_config.json
,
Feb 9 2018
|
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by maa...@glikm.com
, Mar 3 2017Example for the tested Request object: var request = new Request('http://jsonplaceholder.typicode.com/posts/3', { method: 'post', body: JSON.stringify({ user: 'user', password: 'password' }) });