Skip to content

Commit e57b10f

Browse files
authored
Merge pull request #975 from th37rose/fix/jwt
Fix/jwt
2 parents a8e8b9a + 200fdb6 commit e57b10f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/util/AdvancedMapUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class AdvancedMapUtils {
1212
* @return The string value if found, otherwise null.
1313
*/
1414
public static String getString(Map<String, Object> map, String key) {
15-
if(key == null) return null;
15+
if(key == null || key.equals("false")) return null;
1616
String[] parts = key.split("\\.");
1717
Object current = map;
1818

server/api-service/lowcoder-server/src/test/java/org/lowcoder/api/authentication/AdvancedMapUtilsTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ public void testGetStringFromMap() throws Exception {
1717
Collections.singletonMap("def", Collections.singletonMap("hi", "hello world")),
1818
Collections.singletonMap("def", Collections.singletonMap("hi", "another value"))
1919
));
20+
nestedMap.put("false", "123");
2021

2122
String value0 = AdvancedMapUtils.getString(nestedMap, "abc[0].def.hi");
2223
String value1 = AdvancedMapUtils.getString(nestedMap, "abc[1].def.hi");
24+
String value2 = AdvancedMapUtils.getString(nestedMap, "false");
2325
Assertions.assertSame("hello world", value0);
2426
Assertions.assertSame("another value", value1);
27+
Assertions.assertSame(null, value2);
2528
}
2629
}

0 commit comments

Comments
 (0)