update libmozhi; fix API language regex
All checks were successful
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Successful in 17m43s
mozhi pipeline / Build and publish artifacts (push) Successful in 54m46s

This commit is contained in:
Arya 2024-09-11 13:44:22 +05:30
parent 31bb18994b
commit a2789b2a53
Signed by: arya
GPG Key ID: 842D12BDA50DF120
3 changed files with 5 additions and 5 deletions

2
go.mod
View File

@ -7,7 +7,7 @@ replace github.com/OwO-Network/gdeeplx => github.com/gi-yt/gdeeplx v0.0.0-202308
//replace codeberg.org/aryak/libmozhi => /home/arya/projects/mozhi/libmozhi //replace codeberg.org/aryak/libmozhi => /home/arya/projects/mozhi/libmozhi
require ( require (
codeberg.org/aryak/libmozhi v0.0.0-20240901003115-73c39bb218c2 codeberg.org/aryak/libmozhi v0.0.0-20240911074141-3bb816223b76
github.com/gofiber/fiber/v2 v2.52.5 github.com/gofiber/fiber/v2 v2.52.5
github.com/gofiber/swagger v1.1.0 github.com/gofiber/swagger v1.1.0
github.com/gofiber/template v1.8.0 github.com/gofiber/template v1.8.0

4
go.sum
View File

@ -45,8 +45,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
codeberg.org/aryak/libmozhi v0.0.0-20240901003115-73c39bb218c2 h1:pu7h+80d1QUc25sYzR1PhInyqH6ny8tk+Yj8Zv4eCmc= codeberg.org/aryak/libmozhi v0.0.0-20240911074141-3bb816223b76 h1:/vYhXnknJlKNIdoTeXVo+X9a+J7ByClUgGXNSyOs6YE=
codeberg.org/aryak/libmozhi v0.0.0-20240901003115-73c39bb218c2/go.mod h1:cLOtjCmU2AsoL1B+kOzjOMWXYcsdewK8A5s5d/lQVBM= codeberg.org/aryak/libmozhi v0.0.0-20240911074141-3bb816223b76/go.mod h1:cLOtjCmU2AsoL1B+kOzjOMWXYcsdewK8A5s5d/lQVBM=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=

View File

@ -80,8 +80,8 @@ func HandleTTS(c *fiber.Ctx) error {
// @Router /api/translate [get] // @Router /api/translate [get]
func HandleTranslate(c *fiber.Ctx) error { func HandleTranslate(c *fiber.Ctx) error {
engine := utils.Sanitize(utils.GetQueryOrFormValue(c, "engine"), "alpha") engine := utils.Sanitize(utils.GetQueryOrFormValue(c, "engine"), "alpha")
from := utils.Sanitize(utils.GetQueryOrFormValue(c, "from"), "alpha") from := utils.GetQueryOrFormValue(c, "from")
to := utils.Sanitize(utils.GetQueryOrFormValue(c, "to"), "alpha") to := utils.GetQueryOrFormValue(c, "to")
text := utils.GetQueryOrFormValue(c, "text") text := utils.GetQueryOrFormValue(c, "text")
if engine == "" || from == "" || to == "" || text == "" { if engine == "" || from == "" || to == "" || text == "" {
return fiber.NewError(fiber.StatusBadRequest, "from, to, engine, text are required query strings.") return fiber.NewError(fiber.StatusBadRequest, "from, to, engine, text are required query strings.")