URLOption: allow uppercase in resource name
This commit is contained in:
@ -506,7 +506,7 @@ class EmailOption(DomainnameOption):
|
||||
class URLOption(DomainnameOption):
|
||||
__slots__ = tuple()
|
||||
proto_re = re.compile(r'(http|https)://')
|
||||
path_re = re.compile(r"^[a-z0-9\-\._~:/\?#\[\]@!%\$&\'\(\)\*\+,;=]+$")
|
||||
path_re = re.compile(r"^[A-Za-z0-9\-\._~:/\?#\[\]@!%\$&\'\(\)\*\+,;=]+$")
|
||||
|
||||
def _validate(self, value, context=undefined):
|
||||
self._impl_valid_unicode(value)
|
||||
@ -538,7 +538,7 @@ class URLOption(DomainnameOption):
|
||||
super(URLOption, self)._second_level_validation(domain, False)
|
||||
# validate file
|
||||
if files is not None and files != '' and not self.path_re.search(files):
|
||||
raise ValueError(_('invalid url, must ends with filename')) # pragma: optional cover
|
||||
raise ValueError(_('invalid url, must ends with a valid resource name')) # pragma: optional cover
|
||||
|
||||
def _second_level_validation(self, value, warnings_only):
|
||||
pass
|
||||
|
Reference in New Issue
Block a user