Permalink
Browse files

If the endpoint URL already had URL parameters, use an ampersand inst…

…ead to append URL parameters. (This is needed for authenticated embed.ly requests, for example.)
  • Loading branch information...
1 parent de4ef62 commit 0d69856d2685f3507cdf276092de9920454e6f88 Chris Dary committed May 30, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 oembed/__init__.py
View
5 oembed/__init__.py
@@ -303,7 +303,10 @@ def request(self, url, **opt):
urlApi = self._urlApi.replace('{format}', params['format'])
del params['format']
- return "%s?%s" % (urlApi, urllib.urlencode(params))
+ if '?' in urlApi:
+ return "%s&%s" % (urlApi, urllib.urlencode(params))
+ else:
+ return "%s?%s" % (urlApi, urllib.urlencode(params))
def get(self, url, **opt):
'''

0 comments on commit 0d69856

Please sign in to comment.