Open Bug 1506603 Opened 6 years ago Updated 2 years ago

Response tab - copy does not work correctly

Categories

(DevTools :: Netmonitor, defect, P3)

63 Branch
defect

Tracking

(Not tracked)

People

(Reporter: david.balazic, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

315 bytes, application/octet-stream
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0

Steps to reproduce:

Opened (F12) devtools and switched to the Network tab.
Loaded a (private) page that has some AJAX calls.


Actual results:

The response of one AJAX call can not be properly copied from the Response subtab.


Expected results:

Copy worked fine.

The response is text/xml. If I select a few words, I can copy them fine. But if I select all (ctrl-a) then only a small part is coped (the first 220 characters, it seems. The last character copied is a greater-than character.

It seems to work correctly with shorter responses, this one is 56.17 KB, as shown in the Size column.
Turns out there was a null byte at offset 220 in the response.

FF should still copy it correctly.
This seems related:

If XML containing a NULL byte is the response of a GET request in a FF tab, the error report on the page also cuts off the string at the NULL byte:

XML Parsing Error: not well-formed
Location: https://localhost:8443/test_webservice/services/tester/test1
Line Number 1, Column 145:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:test1Response xmlns:ns2="http://xx.yyy.zz/"><ns2:test1>foo    <---- it is cut off here


Show source (ctrl-u) shows the entire XML response.

Can you please attach a simple test case (or URL), so we can test it on our machines?
Thanks!
Honza

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(david.balazic)
Priority: -- → P3
Attached file test.jsp

Put the attached test.jsp into a plain tomcat installation, then try to load it like http://localhost/ROOT/test.jsp (or similar).

This reproduces issue 1.

As for issue 2, now it does not show any of the content.... wait, now it does. Weird. Apparently the page output changes with each refresh between these 3 options:

In all cases ctrl-u shows the correct page source:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:test1Response xmlns:ns2="http://xx.yyy.zz/"><ns2:test1>foo[0000]</ns2:test1></ns2:test1Response></soap:Body></soap:Envelope>

(note that when selecting all and copying, again it is cut at the zero byte, only the part from begin to zero is copied)

PS: You can try to have the same file served by using apache and plain HTML, but I guess putting the NUL bytes in it would be tricky.

PPS: Now I tested with FF v64.0, behaves same as before.

Flags: needinfo?(david.balazic)

This should be fixed by work in bug 1613885 and it work for me on my machine.

David, can you please verify on your machine using Firefox Nightly build, thanks!
https://www.mozilla.org/en-US/firefox/channel/desktop/

Honza

Flags: needinfo?(david.balazic)

Testing with nightly 76.0a1 (2020-03-16) (64-bit)

(In reply to David Balažic from comment #4)

In all cases ctrl-u shows the correct page source:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:test1Response xmlns:ns2="http://xx.yyy.zz/"><ns2:test1>foo[0000]</ns2:test1></ns2:test1Response></soap:Body></soap:Envelope>

(note that when selecting all and copying, again it is cut at the zero byte, only the part from begin to zero is copied)

This all is still behaving the same, as in the quoted message:

  • text cut in the page
  • copying from the source display (ctrl-u) is cut off at the NUL character: I select foo[0000]</ns2 , what is copied/pasted: foo

Original issue (devtools/network/response can not be copied) is still the same too: if I select part of all of the response of the above test.jsp, and try to copy, only the part up to the NUL character is copied.

Flags: needinfo?(david.balazic)

Hey David,

(In reply to David Balažic from comment #2)

This seems related:

If XML containing a NULL byte is the response of a GET request in a FF tab,
the error report on the page also cuts off the string at the NULL byte:

XML Parsing Error: not well-formed
Location: https://localhost:8443/test_webservice/services/tester/test1
Line Number 1, Column 145:

<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:
test1Response xmlns:ns2="http://xx.yyy.zz/"><ns2:test1>foo <---- it is
cut off here

Show source (ctrl-u) shows the entire XML response.
This doesn't look like a devtools related issue.

As to the original devtools response issue here is a screen cast of what i see

http://g.recordit.co/bwln4DI0NF.gif

Can you please do a screencast of what you get?

Thanks

Flags: needinfo?(david.balazic)

Is that on a mac? Windows might not support NUL characters in clipboard.

I (on Windows 10) get the same as you, except that when I paste the string, it goes only up to the NUL character, all that follows is missing. Like this:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:test1Response xmlns:ns2="http://xx.yyy.zz/"><ns2:test1>foo <---- it is cut off here

Flags: needinfo?(david.balazic)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: