-
-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
Hello,
I started using PSFramework for a module I am writing, and I noticed an interesting "bug" (if you could call it that) - if you try to set one of your config settings as follows:
Set-PSFConfig -Module MyModule -Name URL -Value 'xy://' -Validation uriabsolute
It will still return $true because the validation scriptblock is only looking at IsAbsoluteUri and I guess the [uri] class in Powershell is quite permissive and uses :// as the separator so anything specified before that is treated as "correct".
I know I could write my own custom validation, but I did want to bring this up to your attention. Some potential fixes I can think of are:
- Creating a
Schemeallowlist of some sort for common URIs such ashttp,https,ftp,wss, etc. - Checking that
Hostis not empty
Just throwing some ideas out there, thank you for the great module!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels