From 96536442c594189786487ab0cc3d6dfc09a238ed Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 5 Feb 2017 00:44:34 -0500 Subject: [PATCH] Add not_found.html, plaintext cgit passthrough --- git/blueprints/cgit.py | 8 +++++++- templates/not_found.html | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 templates/not_found.html diff --git a/git/blueprints/cgit.py b/git/blueprints/cgit.py index 7aec1bc..1842958 100644 --- a/git/blueprints/cgit.py +++ b/git/blueprints/cgit.py @@ -1,4 +1,4 @@ -from flask import Blueprint, request, render_template +from flask import Blueprint, Response, request, render_template import requests from git.config import cfg @@ -15,3 +15,9 @@ def cgit_passthrough(user, repo, cgit_path): cgit_html=r.text, owner_name=user, repo_name=repo) + +@cgit.route("///patch") +@cgit.route("///patch/") +def cgit_plain(user, repo): + r = requests.get("{}/{}".format(upstream, request.full_path)) + return Response(r.text, mimetype="text/plain") diff --git a/templates/not_found.html b/templates/not_found.html new file mode 100644 index 0000000..7c773a7 --- /dev/null +++ b/templates/not_found.html @@ -0,0 +1,10 @@ +{% extends "layout.html" %} +{% block body %} +
+

404 Not Found

+

+ Whatever you're looking for, it isn't here. + Index +

+
+{% endblock %} -- 2.38.4