addons/firefox-addons/feed-preview

changeset 37:6bd8a649186d

Fix charset encoding in rewritten Content-Type header

The charset encoding in the rewritten Content-Type header must be UTF-8 since
that is what the original response body will be converted to. This fixes the
garbled text seen when viewing feeds using charset encodings other than UTF-8.
author Guido Berhoerster <guido+feed-preview@berhoerster.name>
date Mon Apr 01 21:04:05 2019 +0200 (14 months ago)
parents da5299097a48
children e25dce8b49c3
files js/background.js
line diff
     1.1 --- a/js/background.js	Mon Apr 01 20:39:08 2019 +0200
     1.2 +++ b/js/background.js	Mon Apr 01 21:04:05 2019 +0200
     1.3 @@ -171,7 +171,7 @@
     1.4  
     1.5      details.responseHeaders[contentTypeIndex] = {
     1.6          name: 'Content-Type',
     1.7 -        value: `application/xml;charset=${contentType.charset}`
     1.8 +        value: 'application/xml;charset=utf-8'
     1.9      };
    1.10  
    1.11      return {responseHeaders: details.responseHeaders};