aboutsummaryrefslogtreecommitdiff
path: root/http_template_funcs.go
blob: a7ebb1e2e121d33e10433f0b8a6b82dc07015b7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-FileContributor: Runxi Yu <https://runxiyu.org>

package main

import (
	"path"
	"strings"
	"net/url"
)

func first_line(s string) string {
	before, _, _ := strings.Cut(s, "\n")
	return before
}

func base_name(s string) string {
	return path.Base(s)
}

func path_escape(s string) string {
	return url.PathEscape(s)
}

func query_escape(s string) string {
	return url.QueryEscape(s)
}