fix #802 replace with getUrlEncoder()
This commit is contained in:
parent
72eac31489
commit
1eb34bdfad
6 changed files with 7 additions and 7 deletions
|
@ -238,7 +238,7 @@ public class AdminGroupAction extends FessAdminAction {
|
|||
switch (form.crudMode) {
|
||||
case CrudMode.CREATE:
|
||||
return OptionalEntity.of(new Group()).map(entity -> {
|
||||
entity.setId(Base64.getEncoder().encodeToString(form.name.getBytes(Constants.CHARSET_UTF_8)));
|
||||
entity.setId(Base64.getUrlEncoder().encodeToString(form.name.getBytes(Constants.CHARSET_UTF_8)));
|
||||
return entity;
|
||||
});
|
||||
case CrudMode.EDIT:
|
||||
|
|
|
@ -83,7 +83,7 @@ public class AdminLogAction extends FessAdminAction {
|
|||
stream.filter(entry -> entry.getFileName().toString().endsWith(".log")).forEach(filePath -> {
|
||||
final Map<String, Object> map = new HashMap<>();
|
||||
final String name = filePath.getFileName().toString();
|
||||
map.put("id", Base64.getEncoder().encodeToString(name.getBytes(StandardCharsets.UTF_8)));
|
||||
map.put("id", Base64.getUrlEncoder().encodeToString(name.getBytes(StandardCharsets.UTF_8)));
|
||||
map.put("name", name);
|
||||
try {
|
||||
map.put("lastModified", new Date(Files.getLastModifiedTime(filePath).toMillis()));
|
||||
|
|
|
@ -192,7 +192,7 @@ public class AdminRoleAction extends FessAdminAction {
|
|||
switch (form.crudMode) {
|
||||
case CrudMode.CREATE:
|
||||
return OptionalEntity.of(new Role()).map(entity -> {
|
||||
entity.setId(Base64.getEncoder().encodeToString(form.name.getBytes(Constants.CHARSET_UTF_8)));
|
||||
entity.setId(Base64.getUrlEncoder().encodeToString(form.name.getBytes(Constants.CHARSET_UTF_8)));
|
||||
return entity;
|
||||
});
|
||||
case CrudMode.EDIT:
|
||||
|
|
|
@ -261,7 +261,7 @@ public class AdminUserAction extends FessAdminAction {
|
|||
switch (form.crudMode) {
|
||||
case CrudMode.CREATE:
|
||||
return OptionalEntity.of(new User()).map(entity -> {
|
||||
entity.setId(Base64.getEncoder().encodeToString(form.name.getBytes(Constants.CHARSET_UTF_8)));
|
||||
entity.setId(Base64.getUrlEncoder().encodeToString(form.name.getBytes(Constants.CHARSET_UTF_8)));
|
||||
return entity;
|
||||
});
|
||||
case CrudMode.EDIT:
|
||||
|
|
|
@ -39,7 +39,7 @@ public abstract class DictionaryCreator {
|
|||
}
|
||||
|
||||
protected String encodePath(final String path) {
|
||||
return Base64.getEncoder().encodeToString(path.getBytes(Constants.CHARSET_UTF_8));
|
||||
return Base64.getUrlEncoder().encodeToString(path.getBytes(Constants.CHARSET_UTF_8));
|
||||
}
|
||||
|
||||
protected boolean isTarget(final String path) {
|
||||
|
|
|
@ -307,9 +307,9 @@ public class LdapManager {
|
|||
processSearchRoles(result, (entryDn, name) -> {
|
||||
final String lowerEntryDn = entryDn.toLowerCase(Locale.ROOT);
|
||||
if (lowerEntryDn.indexOf(lowerGroupDn) != -1) {
|
||||
groupList.add(Base64.getEncoder().encodeToString(name.getBytes(Constants.CHARSET_UTF_8)));
|
||||
groupList.add(Base64.getUrlEncoder().encodeToString(name.getBytes(Constants.CHARSET_UTF_8)));
|
||||
} else if (lowerEntryDn.indexOf(lowerRoleDn) != -1) {
|
||||
roleList.add(Base64.getEncoder().encodeToString(name.getBytes(Constants.CHARSET_UTF_8)));
|
||||
roleList.add(Base64.getUrlEncoder().encodeToString(name.getBytes(Constants.CHARSET_UTF_8)));
|
||||
}
|
||||
});
|
||||
user.setGroups(groupList.toArray(new String[groupList.size()]));
|
||||
|
|
Loading…
Add table
Reference in a new issue