Merge safe values into a single source file, also skip fmt.Println() altogether for yukari.FullVersion()

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: file:///srv/svn/repo/yukari/trunk@148 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
yakumo.izuru 2024-03-21 11:19:06 +00:00
parent 498e44f0c7
commit 3720388827
3 changed files with 10 additions and 11 deletions

View File

@ -1,9 +0,0 @@
package main
var LINK_HTTP_EQUIV_SAFE_VALUES [][]byte = [][]byte{
// X-UA-Compatible will be added automaticaly, so it can be skipped
[]byte("date"),
[]byte("last-modified"),
[]byte("refresh"), // URL rewrite
[]byte("content-language"),
}

View File

@ -873,7 +873,7 @@ func (p *Proxy) serveExitYukariPage(ctx *fasthttp.RequestCtx, uri *url.URL) {
ctx.SetContentType("text/html")
ctx.SetStatusCode(403)
ctx.Write([]byte(YUKARI_HTML_PAGE_START))
ctx.Write([]byte("<h2>You are about to exit YukariSukima</h2>"))
ctx.Write([]byte("<h2>You are about to exit Yukari no Sukima</h2>"))
ctx.Write([]byte("<p>Following</p><p><a href=\""))
ctx.Write([]byte(html.EscapeString(uri.String())))
ctx.Write([]byte("\" rel=\"noreferrer\">"))
@ -933,7 +933,7 @@ func main() {
config.Config.MaxConnsPerHost = 4
if version {
fmt.Println(yukari.FullVersion())
yukari.FullVersion()
return
}

View File

@ -1,5 +1,13 @@
package main
var LINK_HTTP_EQUIV_SAFE_VALUES [][]byte = [][]byte{
// X-UA-Compatible will be added automaticaly, so it can be skipped
[]byte("date"),
[]byte("last-modified"),
[]byte("refresh"), // URL rewrite
[]byte("content-language"),
}
var LINK_REL_SAFE_VALUES [][]byte = [][]byte{
[]byte("alternate"),
[]byte("archives"),