Commit 281d9c80 by polesye

Revert: Allow any part of protocol name to be lowercase or uppercase.

parent 2261d4c4
......@@ -2,9 +2,8 @@
import logging
from uuid import uuid4
from requests.packages.urllib3.util import parse_url
from django.core.exceptions import PermissionDenied, ValidationError
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_required
from xmodule.modulestore import Location
......@@ -135,15 +134,6 @@ def save_item(request):
field.write_to(existing_item, value)
if existing_item.category == 'video':
allowedSchemes = ['https']
# The entire site is served from https, so browsers with good
# security will reject non-https URLs anyway.
# Also, following video module specific code is here, because front-end
# metadata fields doesn't support validation.
if metadata_key == 'html5_sources' and not all([parse_url(u).scheme.lower() in allowedSchemes for u in value]):
raise ValidationError(u'HTML5 video sources support following protocols: {0}.'.format(' '.join(allowedSchemes)))
# Save the data that we've just changed to the underlying
# MongoKeyValueStore before we update the mongo datastore.
existing_item.save()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment