Skip to content

fix(cli): show clean error instead of panic for invalid --unsafely-ignore-certificate-errors value#32868

Open
bartlomieju wants to merge 1 commit intomainfrom
fix/unsafely-ignore-certificate-errors-panic
Open

fix(cli): show clean error instead of panic for invalid --unsafely-ignore-certificate-errors value#32868
bartlomieju wants to merge 1 commit intomainfrom
fix/unsafely-ignore-certificate-errors-panic

Conversation

@bartlomieju
Copy link
Member

Summary

  • Fixes a panic when a URL (e.g. https://example.com/) is passed to --unsafely-ignore-certificate-errors, which only accepts domains and IPs.
  • Changed unsafely_ignore_certificate_errors_parse to return clap::error::Result<()> and propagate the validation error instead of .unwrap()-ing it.
  • Updated all three call sites and upgrade_parse to propagate the error.

Fixes #30513

Test plan

  • ./target/debug/deno run --unsafely-ignore-certificate-errors=https://example.com/ now prints error: invalid value 'https://example.com/': URLs are not supported, only domains and ips instead of panicking
  • ./target/debug/deno run --unsafely-ignore-certificate-errors=example.com still works as before

🤖 Generated with Claude Code

…nore-certificate-errors value

When a URL is passed to `--unsafely-ignore-certificate-errors` (e.g.
`https://example.com/`), Deno panicked due to an `.unwrap()` on a clap
validation error. This changes the parsing function to propagate the
error properly, resulting in a clean error message instead of a panic.

Fixes #30513

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic when supplying URL to --unsafely-ignore-certificate-errors

1 participant