Skip to content

Commit

Permalink
Merge pull request #21 from golnazads/master
Browse files Browse the repository at this point in the history
unquote link before redirecting
  • Loading branch information
golnazads authored May 8, 2018
2 parents a21e684 + f15f74d commit dd96ba0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions resolverway/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import requests
from requests.exceptions import HTTPError, ConnectionError
import ast
import urllib

from resolverway.log import log_request

Expand Down Expand Up @@ -47,9 +48,7 @@ def process_resolver_response(self, the_json_response):
if (action == 'redirect'):
link = the_json_response.get('link', None)
if link:
# gunicorn does not like / so it is passed as , and returned back to / here if need to (i.e. for DOI links)
link = link.replace(',', '/')

link = urllib.unquote(link)
current_app.logger.info('redirecting to %s' %(link))
log_request(self.bibcode, self.user_id, self.link_type, link, self.referrer, self.client_id, self.access_token)
return self.redirect(link)
Expand Down

0 comments on commit dd96ba0

Please sign in to comment.