Skip to content

Commit

Permalink
Merge pull request #85 from golnazads/master
Browse files Browse the repository at this point in the history
fixed path when it contains params
  • Loading branch information
golnazads committed Jun 6, 2023
2 parents 4f232c2 + ea60876 commit 6f2bdca
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/python_actions.yml
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- name: Start Redis
uses: supercharge/redis-github-action@1.2.0
uses: supercharge/redis-github-action@1.5.0
with:
redis-version: 6

Expand All @@ -21,7 +21,8 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade setuptools pip
# python -m pip install --upgrade setuptools pip
python -m pip install --upgrade wheel pip
pip install -U -r requirements.txt
pip install -U -r dev-requirements.txt
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
@@ -1,6 +1,6 @@
git+https://github.com/adsabs/ADSMicroserviceUtils.git@v1.2.0
flask-redis==0.4.0
flask-restful==0.3.8
itsdangerous==2.0.1
jinja2==3.0.3
redis==3.3.0


werkzeug==2.0.2
14 changes: 14 additions & 0 deletions resolverway/views.py
Expand Up @@ -299,6 +299,20 @@ def resolver(bibcode, link_type, url):
if url:
url = url.lstrip(':')

# if there are any parameters in the path, it is not going to come through
# need to explicitly be grabbed from request.args
# so grab it and appended to the url
# ie https://www.youtube.com/watch?v=NP0yvK2KK7I
# url contains https://www.youtube.com/watch
# request.args contains ImmutableMultiDict([('v', 'NP0yvK2KK7I')])
params_dict = request.args
if params_dict:
params = ''
for key, value in params_dict.items():
params += '%s=%s&' % (key, value)
if params:
url = "%s?%s" % (url, params)

return LinkRequest(bibcode, link_type.upper(), url=url).process_request()


Expand Down

0 comments on commit 6f2bdca

Please sign in to comment.