Attaching dmesg will be set to text/html as content-type

Asked by Woodrow Shen on 2019-12-11

Attaching dmesg will be set to text/html as content-type

When I attached dmesg to bug, I checked it by clicking its link, and It shown one-line style content without "\n" instead of plain. Obviously it was text/html as content-type from bug page. It's weird because it used to set as text/plain by default. Then I tried to attach another file (e.g. hciconfig) which contained text-only, and that file can be set to text/plain normally. I'm not sure what's going and that's why I'd like to ask here.


Question information

English Edit question
Launchpad itself Edit question
No assignee Edit question
Solved by:
Colin Watson
Last query:
Last reply:
Best Colin Watson (cjwatson) said : #1

We use zope.contenttype to guess the Content-Type for attachments, and, like many of these guessing systems, it can have weird corner cases. For example, if it hasn't come up with anything more definite before that, it will look for '</' in the content and assume text/html if it finds it. Something like that could be what's going on here.

If you think you have a case where we should be doing better, then please file a bug about it.

Woodrow Shen (woodrow-shen) said : #2

After cross reference, it only happened on very strange situation which attached file was scp from another machine. I guess there is something missing from me, so please feel free to close it.

Woodrow Shen (woodrow-shen) said : #3

Thanks Colin Watson, that solved my question.