Pass the referer from the client to the YouTube API

This fixes the errors when the API key is configured to require a
referer for all the requests.
This commit is contained in:
Guruprasad Lakshmi Narayanan
2019-08-29 23:36:20 +05:30
parent dea918b8b8
commit fad200f81b
2 changed files with 10 additions and 4 deletions

View File

@@ -385,7 +385,7 @@ class VideoStudentViewHandlers(object):
runtime uses a similar REST API that's not an XBlock handler.
"""
from lms.djangoapps.courseware.views.views import load_metadata_from_youtube
metadata, status_code = load_metadata_from_youtube(video_id=self.youtube_id_1_0)
metadata, status_code = load_metadata_from_youtube(video_id=self.youtube_id_1_0, request=request)
response = Response(json.dumps(metadata), status=status_code)
response.content_type = 'application/json'
return response