Skip to content

Commit

Permalink
Update safe parameters passed into quote_plus.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Oct 2, 2023
1 parent acf2308 commit 5d8c092
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions api/admin/controller/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ def __call__(self, collection, book, path=None):
redirect_url = flask.request.url
if collection:
redirect_url = redirect_url.replace(
collection, quote_plus(collection)
collection, quote_plus(collection, safe="()")
)
if book:
redirect_url = redirect_url.replace(book, quote_plus(book))
redirect_url = redirect_url.replace(

Check warning on line 32 in api/admin/controller/view.py

View check run for this annotation

Codecov / codecov/patch

api/admin/controller/view.py#L32

Added line #L32 was not covered by tests
book, quote_plus(book, safe="()")
)
return redirect(
url_for("admin_sign_in", redirect=redirect_url, _external=True)
)
Expand Down
4 changes: 3 additions & 1 deletion tests/api/test_controller_opdsfeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ def test_feed(
last_item.sort_author,
last_item.id,
]
expect = "key=%s" % quote_plus(json.dumps(expected_pagination_key))
expect = "key=%s" % quote_plus(
json.dumps(expected_pagination_key), safe=","
)
assert expect in next_link

search_link = by_rel["search"]
Expand Down

0 comments on commit 5d8c092

Please sign in to comment.