spidermon icon indicating copy to clipboard operation
spidermon copied to clipboard

Are the `is_url` and `is_email` functions correct?

Open cuducos opened this issue 4 years ago • 0 comments

The is_url and is_email in spidermon/contrib/validation/jsonschema/formats.py returns True is the input is anything but a string.

Thus, dict(), 42, [42, {}, ('a', 'tuple')] would all be valid emails or URLs according to these logic.

Shouldn't these files read like this instead?

    if not isinstance(instance, str_types):
        return False
    # …

cuducos avatar Oct 03 '21 21:10 cuducos