Index

resty-gitweb / c69d6c0

A git web interface for Lua/OpenResty (you're on it right now!)

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
315 Dec 2020 18:527890389Update copyright noticesJosh Stockin132G

Blob @ resty-gitweb / utils / parse_uri.lua

text/plain468 bytesdownload raw
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
8local utils = require("utils/utils")
9
10local _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
20end
21
22return _M
23