mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #317] [MERGED] test: add unit tests for url-safety isDangerousScheme #471
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#471
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/317
Author: @NathanDrake2406
Created: 3/7/2026
Status: ✅ Merged
Merged: 3/7/2026
Merged by: @james-elicx
Base:
main← Head:test/url-safety-coverage📝 Commits (1)
28e2d87test: add unit tests for url-safety isDangerousScheme📊 Changes
1 file changed (+183 additions, -0 deletions)
View changed files
➕
tests/url-safety.test.ts(+183 -0)📄 Description
Summary
isDangerousScheme()inshims/url-safety.ts\u200B,\uFEFF), mixed-case schemes, whitespace between scheme and colonjavascript\u200B:(zero-width space between scheme and colon) is not caught by the regex, but browsers also don't execute itThis file had zero test coverage despite being security-critical — it's used by Link, Form, and navigation shims to block dangerous URI schemes.
Test plan
npx vitest run tests/url-safety.test.ts— 33/33 passing🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.