Closed Bug 1595991 Opened 3 months ago Closed 3 months ago

[autoconfig] Shorten console output for invalid HTML server responses

Categories

(Thunderbird :: Account Manager, enhancement, minor)

enhancement
Not set
minor

Tracking

(thunderbird_esr6871+ fixed, thunderbird71 fixed, thunderbird72 fixed)

RESOLVED FIXED
Thunderbird 72.0
Tracking Status
thunderbird_esr68 71+ fixed
thunderbird71 --- fixed
thunderbird72 --- fixed

People

(Reporter: BenB, Assigned: BenB)

Details

Attachments

(1 file, 1 obsolete file)

If we request our autoconfig format and the server responds to "not founds" with an HTML page and a HTTP 200 success code (violating the HTTP spec) instead of a proper HTTP 404, we dump the HTML doc on the console to help diagnose what happened. We're outputting the data, because developers cannot always reproduce situations due to server access and need the console output from users to diagnose.

Instead of dumping the whole doc, just output the first few characters. Maybe 50 chars, less than 1 line. This still allows to analyze what happened and see what happened (invalid HTML server response), but avoids the useless scatter.

Attached patch Cut down the dump, v1 (obsolete) — Splinter Review

As requested

Assignee: nobody → ben.bucksch
Status: NEW → ASSIGNED
Attachment #9108311 - Flags: review?(jorgk)
Severity: normal → minor
OS: Unspecified → All
Hardware: Unspecified → All
Comment on attachment 9108311 [details] [diff] [review]
Cut down the dump, v1

Thanks. That avoids a strange delay when setting up an account in a debug build that makes one wonder what's going on.
Attachment #9108311 - Flags: review?(jorgk)
Attachment #9108311 - Flags: review+
Attachment #9108311 - Flags: approval-comm-esr68+
Attachment #9108311 - Flags: approval-comm-beta+

Added a proper HG header, fixed linting issue and while I was there, also switched to a template string to make it more readable. It still works. Setting up jk@office365.com now shows:

client config xml = "\r\n\r\n\r\n<!DOCTYPE html>\r\n<html lang="de-de

Attachment #9108311 - Attachment is obsolete: true
Attachment #9108348 - Flags: review+
Attachment #9108348 - Flags: approval-comm-esr68+
Attachment #9108348 - Flags: approval-comm-beta+

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/716cec9c6ca5
[autoconfig] Shorten console output for HTML responses. a=jorgk DONTBUILD

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 72.0
You need to log in before you can comment on or make changes to this bug.