From f88da1bfa6b8c20dc98227e2796632125e3a5948 Mon Sep 17 00:00:00 2001 From: golnazads <28757512+golnazads@users.noreply.github.com> Date: Tue, 22 May 2018 15:33:45 -0400 Subject: [PATCH] need to url encode the bibcode only --- resolverway/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resolverway/views.py b/resolverway/views.py index ef94f35..dc8a5a8 100644 --- a/resolverway/views.py +++ b/resolverway/views.py @@ -34,7 +34,9 @@ def __init__(self, bibcode, link_type, url=None, id=None): self.real_ip = None def redirect(self, link): - response = redirect(urllib.quote(link), 302) + # need to urlencode the bibcode only! (ie, 1973A&A....24..337S) + link = link.replace(self.bibcode, urllib.quote(self.bibcode)) + response = redirect(link, 302) response.autocorrect_location_header = False response.headers['user_id'] = self.user_id return response, 302