Merge branch 'stable-2.13'
* stable-2.13: Fix garbled text with Unicode display names obtained from HTTP headers Change-Id: I6d848d28cf453b8bf3d3af888f39fe5b11ef3c3f
This commit is contained in:
@@ -18,6 +18,8 @@ import static com.google.common.base.MoreObjects.firstNonNull;
|
||||
import static com.google.common.base.Strings.emptyToNull;
|
||||
import static com.google.common.net.HttpHeaders.AUTHORIZATION;
|
||||
import static com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GERRIT;
|
||||
import static java.nio.charset.StandardCharsets.ISO_8859_1;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.google.gerrit.extensions.registration.DynamicItem;
|
||||
import com.google.gerrit.httpd.HtmlDomUtil;
|
||||
@@ -143,7 +145,8 @@ class HttpAuthFilter implements Filter {
|
||||
|
||||
String getRemoteDisplayname(HttpServletRequest req) {
|
||||
if (displaynameHeader != null) {
|
||||
return emptyToNull(req.getHeader(displaynameHeader));
|
||||
String raw = req.getHeader(displaynameHeader);
|
||||
return emptyToNull(new String(raw.getBytes(ISO_8859_1), UTF_8));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user