magneticow: allow no-auth also in feed url
This commit is contained in:
parent
3a7de3daaf
commit
9a8d59c85e
@ -118,8 +118,12 @@ def torrents():
|
||||
else:
|
||||
context["next_page_exists"] = True
|
||||
|
||||
if app.arguments.noauth:
|
||||
context["subscription_url"] = "/feed/?filter%s" % search
|
||||
else:
|
||||
username, password = flask.request.authorization.username, flask.request.authorization.password
|
||||
context["subscription_url"] = "/feed?filter=%s&hash=%s" % (search, generate_feed_hash(username, password, search))
|
||||
context["subscription_url"] = "/feed?filter=%s&hash=%s" % (
|
||||
search, generate_feed_hash(username, password, search))
|
||||
|
||||
if sort_by:
|
||||
context["sorted_by"] = sort_by
|
||||
@ -210,9 +214,10 @@ def statistics():
|
||||
@app.route("/feed")
|
||||
def feed():
|
||||
filter_ = flask.request.args["filter"]
|
||||
hash_ = flask.request.args["hash"]
|
||||
# Check for all possible users who might be requesting.
|
||||
# pylint disabled: because we do monkey-patch! [in magneticow.__main__.py:main()]
|
||||
if not app.arguments.noauth:
|
||||
hash_ = flask.request.args["hash"]
|
||||
for username, password in app.arguments.user: # pylint: disable=maybe-no-member
|
||||
if generate_feed_hash(username, password, filter_) == hash_:
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user