Skip to content

Commit

Permalink
Merge pull request #81 from golnazads/master
Browse files Browse the repository at this point in the history
fixed verify inhouse url
  • Loading branch information
golnazads committed Aug 13, 2021
2 parents 239f8cc + 2373f89 commit 4f232c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions resolverway/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LinkRequest(object):
user_id = None
referrer = None

re_ads_link = re.compile(r"^(/abs/[12]\d\d\d[A-Za-z&\.]{5}[A-Za-z0-9\.]{9}[A-Z]/abstract)$")
re_ads_link = re.compile(r"^(/abs/[12]\d\d\d[A-Za-z&\.]{5}[A-Za-z0-9\.]{9}[A-Z\.]/abstract)$")

def __init__(self, bibcode, link_type, url=None, id=None):
self.bibcode = bibcode
Expand Down Expand Up @@ -213,8 +213,9 @@ def verify_url(self):
# do not redirect if outside link and did not originate from BBB
return False

def valid_bibcode(self, bibcode):
def verify_bibcode(self, bibcode):
"""
make sure bibcode is ascii, actually any identifier needs to be ascii
:param bibcode:
:return:
Expand All @@ -232,7 +233,7 @@ def process_request(self):
:return:
"""

if self.valid_bibcode(self.bibcode):
if self.verify_bibcode(self.bibcode):
log_the_click = False
# log the request
current_app.logger.info('received request with bibcode=%s and link_type=%s' %(self.bibcode, self.link_type))
Expand Down

0 comments on commit 4f232c2

Please sign in to comment.