You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
I guess the reason is that the content_type property preserves parameters if the new value does not contain any, so the charset is not removed from the header when setting a content type without parameters later on.
The text was updated successfully, but these errors were encountered:
Note that if you specify the content_type as a constructor parameter, there are some "smarts" in the constructor to set the charset (or not) based on the content_type provided. Setting the content_type at a later time does not, unfortunately, benefit from that same logic, so you have to clear the charset manually.
Perhaps every change to content_type could set a default charset in the same manner as in the constructor? Possibly retaining the current charset if there is one and the new content_type looks like a text content type?