A git web interface for Lua/OpenResty (you're on it right now!)
{#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
---|---|---|---|---|---|---|---|---|
3 | 15 Dec 2020 18:52 | 7890389 | Update copyright notices | Josh Stockin | 1 | 3 | 2 | G |
1 | -- resty-gitweb@utils/parse_uri.lua |
2 | -- URI parsing |
3 | |
4 | -- Copyright (c) 2020 Joshua 'joshuas3' Stockin |
5 | -- <https://git.joshstock.in/resty-gitweb> |
6 | -- This software is licensed under the MIT License. |
7 | |
8 | local utils = require("utils/utils") |
9 | |
10 | local _M = function() |
11 | local uri = ngx.var.uri |
12 | local split = string.split(string.sub(uri,2),"/") |
13 | |
14 | local parsed = {} |
15 | parsed.uri = uri |
16 | parsed.parts = split |
17 | parsed.repo = split[1] |
18 | |
19 | return parsed |
20 | end |
21 | |
22 | return _M |
23 |