Feat: decode url-encoded user name in authenticate request header to allow CJK username in header (#7471)

* fix: CJK in header has to be urlEncoded

* refactor: use $tw.utils.decodeURIComponentSafe

* docs: about chagne in this field

* docs: update

* docs: use less "field"
This commit is contained in:
lin onetwo 2023-05-22 19:25:51 +08:00 committed by GitHub
parent 9b78e871aa
commit 3f763775d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 5 deletions

View file

@ -37,7 +37,7 @@ HeaderAuthenticator.prototype.authenticateRequest = function(request,response,st
return false;
} else {
// authenticatedUsername will be undefined for anonymous users
state.authenticatedUsername = username;
state.authenticatedUsername = $tw.utils.decodeURIComponentSafe(username);
return true;
}
};