Add configurable and validatable schemes. #67
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provided is a first approach of configurable but still "validatable" schemes with defaults still in place. As there were a number of issues mentioning this as a "necessary" feature (see: #25, #64 ).
Remarks:
Validator
contract and base, definitely open to feedback and improvements.fromString
) I scratched my head a bit on how to properly pass in the scheme configuration at the right time. Why? In thefromString
method the scheme was (and still is) immediately sanitized and validated, which doesn't leave much room to configure theSchemeValidator
. So I've added an optionalallowedSchemes
parameter.UriInterface
)