Merge pull request #576 from MITx/feature/victor/fix-trailing-location-url
Remove trailing slash from ajax url in ModuleSystem
This commit is contained in:
@@ -198,6 +198,8 @@ def _get_module(user, request, location, student_module_cache, course_id, positi
|
||||
location=descriptor.location.url(),
|
||||
dispatch=''),
|
||||
)
|
||||
# Intended use is as {ajax_url}/{dispatch_command}, so get rid of the trailing slash.
|
||||
ajax_url = ajax_url.rstrip('/')
|
||||
|
||||
# Fully qualified callback URL for external queueing system
|
||||
xqueue_callback_url = '{proto}://{host}'.format(
|
||||
@@ -410,6 +412,10 @@ def modx_dispatch(request, dispatch, location, course_id):
|
||||
'''
|
||||
# ''' (fix emacs broken parsing)
|
||||
|
||||
# Check parameters and fail fast if there's a problem
|
||||
if not Location.is_valid(location):
|
||||
raise Http404("Invalid location")
|
||||
|
||||
# Check for submitted files and basic file size checks
|
||||
p = request.POST.copy()
|
||||
if request.FILES:
|
||||
|
||||
Reference in New Issue
Block a user