unicode in filename
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Arnas Udovicius 2022-08-21 19:35:05 +03:00
parent c946b9daba
commit 6dc8abd6b3

View file

@ -96,7 +96,7 @@ func process(_ context.Context, w gemini.ResponseWriter, r *gemini.Request) {
renderSearch(lang, w, r, client) renderSearch(lang, w, r, client)
case regexp.MustCompile(`^/(sgs|en)/f/?$`).MatchString(r.URL.Path): case regexp.MustCompile(`^/(sgs|en)/f/?$`).MatchString(r.URL.Path):
renderAllFiles(lang, w, client) renderAllFiles(lang, w, client)
case regexp.MustCompile(`^/(sgs|en)/f/([\p{L}\d_+.]+/)+[\d\w]+/[\w_]+.gmi$`).MatchString(r.URL.Path): case regexp.MustCompile(`^/(sgs|en)/f/([\p{L}\d_+.]+/)+[\d\w]+/[\p{L}\d_+.]+.gmi$`).MatchString(r.URL.Path):
renderFile(lang, w, r, client) renderFile(lang, w, r, client)
case regexp.MustCompile(`^/(sgs|en)/f/[\p{L}\d_+.]+(/[\p{L}\d_+.]+)*/?$`).MatchString(r.URL.Path): case regexp.MustCompile(`^/(sgs|en)/f/[\p{L}\d_+.]+(/[\p{L}\d_+.]+)*/?$`).MatchString(r.URL.Path):
renderCategory(lang, w, r, client) renderCategory(lang, w, r, client)