URI encode the X-Page-Title header

Browsers's are inconsistent in how they interpret the encoding
of a response header in an XHR request, so URI encode it so that
it simple ASCII we can then decode it again in the browser.
This commit is contained in:
Tom Hughes 2015-03-17 18:49:39 +00:00
parent 05caad1a5d
commit e2aef40437
3 changed files with 10 additions and 5 deletions

View file

@ -54,7 +54,7 @@ $(document).ready(function () {
if (xhr.getResponseHeader('X-Page-Title')) {
var title = xhr.getResponseHeader('X-Page-Title');
document.title = decodeURIComponent(escape(title));
document.title = decodeURIComponent(title);
}
$('head')