Skip to content

Commit 314f1aa

Browse files
committed
fix(web): treat ?= and ?& as query strings in terminal routes
1 parent f6037e2 commit 314f1aa

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/web/src/terminal-links.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ describe("extractTerminalLinks", () => {
119119
it.each([
120120
" GET /api/trpc/post.list,user.me?batch=1&input=%7B%220%22%3A%7B%22json%22%3Anull%7D%7D 200 in 35ms",
121121
"GET /api/users?id=42 200",
122+
"GET /api/users?=42 200",
123+
"GET /api/search?&q=term 200",
122124
"proxying api/trpc/post.list?batch=1 to the backend",
123125
])("skips request routes carrying a query string in %s", (line) => {
124126
expect(extractTerminalLinks(line)).toEqual([]);

‎apps/web/src/terminal-links.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const TRAILING_PATH_PUNCTUATION_PATTERN = /[.,;:!?]+$/;
4141
// Request logs print routes like `/api/trpc/post.list?batch=1`; files don't carry
4242
// queries, while prose like `src/main.ts?` still trims to a path.
4343
const TOKEN_PATTERN = /[^\s"'`<>]*/y;
44-
const QUERY_STRING_PATTERN = /\?[A-Za-z0-9_%-]/;
44+
const QUERY_STRING_PATTERN = /\?[A-Za-z0-9_%&=-]/;
4545

4646
function trimClosingDelimiters(value: string, kind: TerminalLinkKind): string {
4747
let output = value.replace(

0 commit comments

Comments
 (0)