Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use secure connection to query soundcloud endpoint #68

Merged
merged 3 commits into from Apr 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions embed_video/backends.py
Expand Up @@ -372,7 +372,7 @@ class SoundCloudBackend(VideoBackend):
"""
Backend for SoundCloud URLs.
"""
base_url = 'http://soundcloud.com/oembed'
base_url = '{protocol}://soundcloud.com/oembed'

re_detect = re.compile(r'^(http(s)?://(www\.)?)?soundcloud\.com/.*', re.I)
re_code = re.compile(r'src=".*%2F(?P<code>\d+)&show_artwork.*"', re.I)
Expand All @@ -397,7 +397,8 @@ def get_info(self):
'format': 'json',
'url': self._url,
}
r = requests.get(self.base_url, params=params,
r = requests.get(self.base_url.format(protocol=self.protocol),
params=params,
timeout=EMBED_VIDEO_TIMEOUT)

if r.status_code != 200:
Expand Down
1 change: 0 additions & 1 deletion embed_video/tests/templatetags/tests_embed_video_tags.py
Expand Up @@ -332,4 +332,3 @@ class InsecureRequest(RequestFactory):
context = {'request': InsecureRequest()}
backend = VideoNode.get_backend('http://www.youtube.com/watch?v=jsrRJyHBvzw', context)
self.assertFalse(backend.is_secure)