Skip to content

URL validation is incorrect #102

@2shrestha22

Description

@2shrestha22

The URL validation implementation is incorrect and always return valid for any string.

Current implementation:

    final uri = Uri.tryParse(value);
    if (uri != null && allowedSchemes != null) {
      return allowedSchemes!.contains(uri.scheme);
    }
    return uri != null;

But only checking url!=null is not sufficient since. URI.tryParse() does not return null for example, hello, iamnotavalidurl etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions