~edwargix/git.sr.ht

2c3e156d8dee5b000829450b4ec5a818d6d5b357 — Drew DeVault 7 years ago e322fdb
Fix trailing slashes, I hope
1 files changed, 2 insertions(+), 1 deletions(-)

M gitsrht/blueprints/public.py
M gitsrht/blueprints/public.py => gitsrht/blueprints/public.py +2 -1
@@ 38,6 38,7 @@ def check_repo(user, repo, authorized=current_user):
    return u, _repo

@public.route("/<owner_name>/<repo_name>")
@public.route("/<owner_name>/<repo_name>/")
@public.route("/<owner_name>/<repo_name>/<path:cgit_path>")
def cgit_passthrough(owner_name, repo_name, cgit_path=""):
    owner, repo = get_repo(owner_name, repo_name)


@@ 93,8 94,8 @@ def cgit_plain(owner_name, repo_name, op, path=None):
    return Response(stream_with_context(r.iter_content()), content_type=r.headers['content-type'])

@public.route("/~<username>")
@public.route("/~<username>/")
def user_index(username):
    username = username.rstrip("/")
    user = User.query.filter(User.username == username).first()
    if not user:
        abort(404)