~edwargix/git.sr.ht

b3b86eaaeb6a266d98f4cdf38d2b526bf7c54158 — Drew DeVault 7 years ago 8f32f21
Fix passthrough to cgit
2 files changed, 1 insertions(+), 3 deletions(-)

M gitsrht/access.py
M gitsrht/blueprints/public.py
M gitsrht/access.py => gitsrht/access.py +0 -2
@@ 47,8 47,6 @@ def get_access(repo, user=None):
    return UserAccess.read

def has_access(repo, access, user=None):
    if not user:
        user = current_user
    return access in get_access(repo, user)

def check_access(owner_name, repo_name, access):

M gitsrht/blueprints/public.py => gitsrht/blueprints/public.py +1 -1
@@ 83,7 83,7 @@ def cgit_passthrough(owner_name, repo_name, cgit_path):
@public.route("/<owner_name>/<repo_name>/<op>/<path:path>")
def cgit_plain(owner_name, repo_name, op, path):
    if not op in ["patch", "plain", "snapshot"]:
        abort(404)
        return cgit_passthrough(owner_name, repo_name, op + "/" + cgit_path)
    owner, repo = get_repo(owner_name, repo_name)
    if isinstance(repo, Redirect):
        return redirect(url_for(".cgit_plain",