File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,15 @@ describe('SafeUrlSchema', () => {
2323
2424 it ( 'rejects invalid URLs' , ( ) => {
2525 expect ( ( ) => SafeUrlSchema . parse ( 'not-a-url' ) ) . toThrow ( ) ;
26- expect ( ( ) => SafeUrlSchema . parse ( '' ) ) . toThrow ( ) ;
2726 } ) ;
2827
2928 it ( 'works with safeParse' , ( ) => {
3029 expect ( ( ) => SafeUrlSchema . safeParse ( 'not-a-url' ) ) . not . toThrow ( ) ;
3130 } ) ;
31+
32+ it ( 'works with empty string' , ( ) => {
33+ expect ( ( ) => SafeUrlSchema . parse ( '' ) ) . not . toThrow ( ) ;
34+ } ) ;
3235} ) ;
3336
3437describe ( 'OAuthMetadataSchema' , ( ) => {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export const SafeUrlSchema = z.string().url()
2020 return u . protocol !== 'javascript:' && u . protocol !== 'data:' && u . protocol !== 'vbscript:' ;
2121 } ,
2222 { message : "URL cannot use javascript:, data:, or vbscript: scheme" }
23- ) ;
23+ ) . or ( z . literal ( "" ) ) ;
2424
2525
2626/**
You can’t perform that action at this time.
0 commit comments