Skip to content

Commit 6dc8cf2

Browse files
committed
Add code comment to OriginScheme
1 parent 84d9613 commit 6dc8cf2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/frontend/src/lib/utils/transport/legacy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const REDIRECT_SESSION_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
2828
const OUTER_DELEGATION_EXPIRATION_MS = 30 * 24 * 60 * 60 * 1000; // 30 days
2929

3030
const RedirectMessageSchema = z.object({
31-
origin: OriginSchema,
31+
origin: OriginSchema, // Accepts http, https, chrome-extension, etc.
3232
data: z.unknown(),
3333
});
3434

src/frontend/src/lib/utils/transport/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ export const StringOrNumberToBigIntCodec = z.codec(
133133
},
134134
);
135135

136+
/**
137+
* Validates that a string is a valid origin with
138+
* no path, query, or fragment. Accepts any URL
139+
* scheme (e.g. http, https, chrome-extension).
140+
*/
136141
export const OriginSchema = z.string().refine(
137142
(value) => {
138143
try {

0 commit comments

Comments
 (0)