Skip to content

Commit 2e147ff

Browse files
authored
Fix query string parsing (#518)
* Fix query string parsing * [AUTOMATED]: Prettier Code Styling * Feedback
1 parent fc81427 commit 2e147ff

File tree

1 file changed

+4
-1
lines changed
  • packages/database/src/core/util/libs

1 file changed

+4
-1
lines changed

packages/database/src/core/util/libs/parser.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,14 @@ function decodeQuery(queryString: string): { [key: string]: string } {
4747
queryString = queryString.substring(1);
4848
}
4949
for (const segment of queryString.split('&')) {
50+
if (segment.length === 0) {
51+
continue;
52+
}
5053
const kv = segment.split('=');
5154
if (kv.length === 2) {
5255
results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]);
5356
} else {
54-
warn('Invalid query string segment: ' + segment);
57+
warn(`Invalid query segment '${segment}' in query '${queryString}'`);
5558
}
5659
}
5760
return results;

0 commit comments

Comments
 (0)