New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 698209 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug



Sign in to add a comment

Calling Request.clone() stops Chrome network tools from being able to read request payload

Reported by maa...@glikm.com, Mar 3 2017

Issue description

Chrome 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.
 
valid.png
183 KB View Download
invalid.png
173 KB View Download

Comment 1 by maa...@glikm.com, Mar 3 2017

Example for the tested Request object:

var request = new Request('http://jsonplaceholder.typicode.com/posts/3', {
  method: 'post',
  body: JSON.stringify({ user: 'user', password: 'password' })
});
Labels: Needs-Triage-M56
Cc: sureshkumari@chromium.org
Components: Platform>DevTools
Labels: Needs-Feedback
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..
698209.mp4
1.4 MB View Download

Comment 4 by maa...@glikm.com, Mar 6 2017

Screencast matches my issue.

Thanks
Project Member

Comment 5 by sheriffbot@chromium.org, Mar 6 2017

Labels: -Needs-Feedback
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
Cc: jmukthavaram@chromium.org
Labels: Needs-Feedback
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!!

Comment 7 by maa...@glikm.com, 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).

firefox.mp4
4.2 MB View Download
Project Member

Comment 8 by sheriffbot@chromium.org, Mar 8 2017

Labels: -Needs-Feedback
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
Cc: kavvaru@chromium.org
Components: -Platform>DevTools Platform>DevTools>Network
Labels: -Pri-3 -Needs-Triage-M56 M-59 OS-Linux OS-Mac OS-Windows Pri-1
Status: Untriaged (was: Unconfirmed)
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,
Owner: allada@chromium.org
Status: Assigned (was: Untriaged)
Cc: susanjuniab@chromium.org
 Issue 768283  has been merged into this issue.
Owner: eostroukhov@chromium.org
Status: Started (was: Assigned)
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);
Cc: eostroukhov@chromium.org
 Issue 804843  has been merged into this issue.
Project Member

Comment 16 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)

Sign in to add a comment