We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
The allowRelative option is ignored when http isn't present in the list of schemes
allowRelative
http
To Reproduce
Define a field as follows:
{ name: 'url', title: 'URL', type: 'url', validation: Rule => Rule.uri({ scheme: ['https'], allowRelative: true, }), }
Then in that field, enter a relative URL such as /example - this will trigger a validation error of "Does not match allowed protocols/schemes".
/example
The following code works as expected:
{ name: 'url', title: 'URL', type: 'url', validation: Rule => Rule.uri({ scheme: ['http', 'https'], allowRelative: true, }), }
Expected behavior
This should not cause a validation error.
Screenshots
Which versions of Sanity are you using?
@sanity/cli (global) 3.58.0 (up to date) @sanity/cli 3.58.0 (up to date) @sanity/code-input 4.1.4 (up to date) @sanity/color-input 4.0.1 (up to date) @sanity/components 2.14.0 (up to date) @sanity/dashboard 4.0.0 (up to date) @sanity/icons 3.4.0 (up to date) @sanity/production-preview 2.35.3 (up to date) @sanity/vision 3.58.0 (up to date) sanity 3.58.0 (up to date)
What operating system are you using? macOS 14.6.1 (23G93)
Which versions of Node.js / npm are you running?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
The
allowRelative
option is ignored whenhttp
isn't present in the list of schemesTo Reproduce
Define a field as follows:
Then in that field, enter a relative URL such as
/example
- this will trigger a validation error of "Does not match allowed protocols/schemes".The following code works as expected:
Expected behavior
This should not cause a validation error.
Screenshots
Which versions of Sanity are you using?
What operating system are you using?
macOS 14.6.1 (23G93)
Which versions of Node.js / npm are you running?
The text was updated successfully, but these errors were encountered: