diff options
Diffstat (limited to 'git-gmi/gateway.py')
-rw-r--r-- | git-gmi/gateway.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/git-gmi/gateway.py b/git-gmi/gateway.py index f8c4601..bb7f2e0 100644 --- a/git-gmi/gateway.py +++ b/git-gmi/gateway.py @@ -9,7 +9,8 @@ from os import environ, listdir def handle_cgi_request(path: str, query: str): # intended to work with Jetforce. - # url: gemini://git.gemini.site/cgi-bin/cgi.py/repo/src/static/css/[index.css] + # hypothetical example: + # url: gemini://git.gemini.site/git/cgi/repo/src/static/css/[index.css] # path: /repo/src/static/css/[index.css] # path_trace = ['repo', 'src', 'static', 'css', 'index.css'] path_trace = path[1:].split("/") @@ -29,6 +30,7 @@ def handle_cgi_request(path: str, query: str): if len(path_trace) > 1: view = path_trace[1] # e.g. summary, tree, log else: + # gemini://git.gemini.site/git/cgi/<repo>/ print("31 summary") return @@ -42,10 +44,12 @@ def handle_cgi_request(path: str, query: str): elif view == "tree": if len(path_trace) == 2: + # gemini://git.gemini.site/git/cgi/<repo>/tree/ print(f"31 {MAIN_BRANCH}/") return if len(path_trace) > 2: + # gemini://git.gemini.site/git/cgi/<repo>/tree/<branch>/ branch = path_trace[2] location = path_trace[3:] |