Open Bug 1525139 Opened 5 years ago Updated 6 months ago

Page Info reports size from the Content-Length header, which is not guaranteed to match the actual file size

Categories

(Firefox :: Page Info Window, defect, P5)

65 Branch
defect

Tracking

()

People

(Reporter: 13hurdw, Unassigned, NeedInfo)

References

()

Details

Attachments

(2 files)

Client: FF 65 Linux

To reproduce:

Page Size given on page info is incorrect, in this case it says 0.28 KB (283 bytes)

File is actually 469 bytes. Correct size shown in network inspector

Expected:
Page info shows actual correct size of response content, in this example 469 bytes.

Priority: -- → P3

Looking at this in the Network inspector shows this header is part of the server response:
Content-Length: 283

I wonder why github sends incorrect headers like this.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: P3 → P5
Summary: Page Info reports incorrect size in bytes → Page Info reports size from the Content-Length header, which is not guaranteed to match the actual file size

(In reply to Florian Quèze [:florian] from comment #1)

Looking at this in the Network inspector shows this header is part of the server response:
Content-Length: 283

I wonder why github sends incorrect headers like this.

Are you sure ? I don't see a content-length field in the response header:

HTTP/1.1 304 Not Modified
Date: Mon, 29 Apr 2019 21:25:27 GMT
Via: 1.1 varnish
Cache-Control: max-age=300
ETag: "ea517bf31e6b535701f67a53faa0847ff26b3a90"
Connection: keep-alive
X-Served-By: cache-dca17781-DCA
X-Cache: HIT
X-Cache-Hits: 2
X-Timer: S1556573128.733287,VS0,VE0
Vary: Authorization,Accept-Encoding
Access-Control-Allow-Origin: *
X-Fastly-Request-ID: 25454cac97792e0927f09b3fc6e890cb80ad0777
Expires: Mon, 29 Apr 2019 21:30:27 GMT
Source-Age: 113

The 283 value doesn't appear in the response header.

Flags: needinfo?(florian)
Severity: normal → S3

This is still reproducible (Firefox 119, Page Info -> General reports 283 bytes), but the response Content-Length field is the correct 469 in curl request:

>curl -I https://raw.githubusercontent.com/mozilla/addons-server/master/.jshintrc
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 469
..
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: