z.string().url() should reject invalid schemes like https://https://example.com · Issue #4406 · colinhacks/zod · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, z.string().url() does not catch malformed URLs such as https://https://example.com.
These are technically invalid, but they still pass validation.
To work around this, I had to use a custom refine() with a URL parser and an additional scheme check.
Currently, z.string().url() does not catch malformed URLs such as https://https://example.com.
These are technically invalid, but they still pass validation.
To work around this, I had to use a custom refine() with a URL parser and an additional scheme check.
Here's the custom validation I implemented:
The text was updated successfully, but these errors were encountered: