comparison js/background.js @ 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, 01 Apr 2019 21:04:05 +0200
parents 688d75e554e0
children 586eebf8efb7
comparison
equal deleted inserted replaced
36:da5299097a48 37:6bd8a649186d
169 filter.close(); 169 filter.close();
170 }); 170 });
171 171
172 details.responseHeaders[contentTypeIndex] = { 172 details.responseHeaders[contentTypeIndex] = {
173 name: 'Content-Type', 173 name: 'Content-Type',
174 value: `application/xml;charset=${contentType.charset}` 174 value: 'application/xml;charset=utf-8'
175 }; 175 };
176 176
177 return {responseHeaders: details.responseHeaders}; 177 return {responseHeaders: details.responseHeaders};
178 }, 178 },
179 {urls: ['http://*/*', 'https://*/*'], types: ['main_frame']}, 179 {urls: ['http://*/*', 'https://*/*'], types: ['main_frame']},