Mercurial Hosting > hghosting
comparison src/admin/add.html.luan @ 5:a09d8bcdc0f9
lower case repos
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 18 May 2022 00:21:44 -0600 |
parents | dfc36e7ed22c |
children | a7187a447835 |
comparison
equal
deleted
inserted
replaced
4:028e74c8889d | 5:a09d8bcdc0f9 |
---|---|
1 local Luan = require "luan:Luan.luan" | 1 local Luan = require "luan:Luan.luan" |
2 local error = Luan.error | 2 local error = Luan.error |
3 local String = require "luan:String.luan" | |
4 local to_lower = String.lower or error() | |
3 local Io = require "luan:Io.luan" | 5 local Io = require "luan:Io.luan" |
4 local Http = require "luan:http/Http.luan" | 6 local Http = require "luan:http/Http.luan" |
5 local Shared = require "site:/lib/Shared.luan" | 7 local Shared = require "site:/lib/Shared.luan" |
6 local head = Shared.head or error() | 8 local head = Shared.head or error() |
7 local header = Shared.admin_header or error() | 9 local header = Shared.admin_header or error() |
12 | 14 |
13 | 15 |
14 local function handle() | 16 local function handle() |
15 local user = get_user() | 17 local user = get_user() |
16 local repo_name = Http.request.parameters.repo or error() | 18 local repo_name = Http.request.parameters.repo or error() |
19 repo_name = to_lower(repo_name) | |
17 if repo_name=="_all" or repo_name=="_private" then | 20 if repo_name=="_all" or repo_name=="_private" then |
18 return [[<p error>Invalid rep name</p>]] | 21 return [[<p error>Invalid rep name</p>]] |
19 end | 22 end |
20 local raw_config = get_raw_config() | 23 local raw_config = get_raw_config() |
21 if raw_config.repos[repo_name] ~= nil then | 24 if raw_config.repos[repo_name] ~= nil then |