Backport support for poorly encoded Location header, close #1138