File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,15 @@ describe('SafeUrlSchema', () => {
18
18
19
19
it ( 'rejects invalid URLs' , ( ) => {
20
20
expect ( ( ) => SafeUrlSchema . parse ( 'not-a-url' ) ) . toThrow ( ) ;
21
- expect ( ( ) => SafeUrlSchema . parse ( '' ) ) . toThrow ( ) ;
22
21
} ) ;
23
22
24
23
it ( 'works with safeParse' , ( ) => {
25
24
expect ( ( ) => SafeUrlSchema . safeParse ( 'not-a-url' ) ) . not . toThrow ( ) ;
26
25
} ) ;
26
+
27
+ it ( 'works with empty string' , ( ) => {
28
+ expect ( ( ) => SafeUrlSchema . parse ( '' ) ) . not . toThrow ( ) ;
29
+ } ) ;
27
30
} ) ;
28
31
29
32
describe ( 'OAuthMetadataSchema' , ( ) => {
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ export const SafeUrlSchema = z
23
23
return u . protocol !== 'javascript:' && u . protocol !== 'data:' && u . protocol !== 'vbscript:' ;
24
24
} ,
25
25
{ message : 'URL cannot use javascript:, data:, or vbscript: scheme' }
26
- ) ;
26
+ )
27
+ . or ( z . literal ( '' ) ) ;
27
28
28
29
/**
29
30
* RFC 9728 OAuth Protected Resource Metadata
You can’t perform that action at this time.
0 commit comments