Wrong document size on 301 redirects
Categories
(DevTools :: Netmonitor, defect, P3)
Tracking
(Not tracked)
People
(Reporter: vechenjivot, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug, )
Details
(Keywords: parity-chrome)
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Steps to reproduce:
I have a site that uses 301 redirects, I am usign the following URL to test:
https://shopche.com/дом-и-градина/домашен-майстор/22
which redirects to
https://shopche.com/дом-и-градина/домашен-майстор
Actual results:
When I inspect the request in the Newtwork tab, it shows the document size returned is 28.89kB compressed.
Expected results:
The actual document size is just 216 B (as seen in Chrome)
Updated•5 years ago
|
Comment 1•5 years ago
|
||
The priority flag is not set for this bug.
:Honza, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 2•5 years ago
|
||
Thanks for the report!
I can't see the problem. When loading https://shopche.com/дом-и-градина/домашен-майстор/22
I am seeing 404
What exactly should I do to reproduce the issue on my machine?
Honza
Reporter | ||
Comment 3•5 years ago
|
||
Sorry, you can test with this url:
https://shopche.com/65-moda
which will redirect to
https://shopche.com/мода
Comment 4•5 years ago
|
||
Thanks I can clearly see the problem now.
Chrome shows: 115 B
Firefox shows: 27.51 KB / 156.71 KB
Screenshot attached.
Honza
Updated•5 years ago
|
Comment 5•5 years ago
|
||
Michal, this looks like the first (redirect) request reports the same size as the second one (the slight difference in the transferred size on the screenshot might be because in include HTTP headers size too).
This could be related to the fact that we don't track the response for redirections and thus using the final response's size?
A few links:
-
DevTools is calculating the transferred as well as real size of responses here:
https://searchfox.org/mozilla-central/rev/070a000dd49aac4a26147e137efcd91a728d13b8/devtools/server/actors/network-monitor/network-response-listener.js#477-479 -
It's part of nsIStreamListener we register for response bodies and nsProgressEventSink
https://searchfox.org/mozilla-central/rev/070a000dd49aac4a26147e137efcd91a728d13b8/devtools/server/actors/network-monitor/network-response-listener.js#382
Can you please confirm?
Honza
Comment 6•5 years ago
|
||
(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #5)
Michal, this looks like the first (redirect) request reports the same size as the second one (the slight difference in the transferred size on the screenshot might be because in include HTTP headers size too).
This could be related to the fact that we don't track the response for redirections and thus using the final response's size?
Yes, it looks like the transferred size on the final channel in the redirect chain is used for all preceding channels in the chain, which is wrong..
Updated•5 years ago
|
Updated•2 years ago
|
Description
•