Gitlab error page is overridden by Firefox internal error on 404 when `browser.http.blank_page_with_error_response.enabled false`
Categories
(Core :: Networking, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox137 | --- | fixed |
People
(Reporter: manuel, Assigned: sekim)
References
Details
(Whiteboard: [necko-triaged][necko-priority-queue])
Attachments
(1 file)
Precondition: disable browser.http.blank_page_with_error_response.enabled
by setting it to false
Example link: https://gitlab.com/gitlab-org/gitlab/-/issues/10000000000
Gitlab response:
HTTP/2 404
server: nginx
date: Thu, 30 Jan 2025 22:59:38 GMT
content-type: text/html; charset=utf-8
cache-control: no-cache
content-security-policy:
permissions-policy: interest-cohort=()
referrer-policy: strict-origin-when-cross-origin
vary: Accept
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-gitlab-custom-error: 1
x-gitlab-meta: {"correlation_id":"01JJWQ1ZXWBRKFZQMBJ32DYFEB","version":"1"}
x-permitted-cross-domain-policies: none
x-request-id: 01JJWQ1ZXWBRKFZQMBJ32DYFEB
x-runtime: 0.086389
x-ua-compatible: IE=edge
x-xss-protection: 1; mode=block
<!DOCTYPE html>
[...]
Assignee | ||
Updated•7 months ago
|
Comment 1•7 months ago
|
||
"No content-length" should not be treated as "content-length: 0" because the former will actually have content.
Comment 2•7 months ago
|
||
if (NS_FAILED(rv) || contentLength <= 0) {
should be
if (NS_SUCCEEDED(rv) && contentLength <= 0) {
Of course we should consider the case where the response is empty and has no "content-length" header field.
Assignee | ||
Comment 3•7 months ago
•
|
||
(In reply to Masatoshi Kimura [:emk] from comment #1)
"No content-length" should not be treated as "content-length: 0" because the former will actually have content.
Right, based on debugging, I think we are getting contentLength
of -1 (no content-length) for this GitLab page.
I think we can fix this by changing it to if (NS_SUCCEEDED(rv) && contentLength == 0) {
Assignee | ||
Updated•7 months ago
|
Assignee | ||
Comment 4•7 months ago
|
||
Comment 6•7 months ago
|
||
bugherder |
Assignee | ||
Comment 7•7 months ago
|
||
(In reply to Pulsebot from comment #5)
Pushed by sekim@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7dc8b9c186f3
Avoid treating responses without a Content-Length header as having
Content-Length of 0 r=manuel,necko-reviewers,kershaw DONTBUILD
Note: The DONTBUILD flag was removed afterwards.
Description
•