mirror of
https://codeberg.org/aryak/mozhi
synced 2024-11-26 16:31:58 +05:30
update libmozhi; fix API language regex
This commit is contained in:
parent
31bb18994b
commit
a2789b2a53
2
go.mod
2
go.mod
@ -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
4
go.sum
@ -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=
|
||||||
|
@ -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.")
|
||||||
|
Loading…
Reference in New Issue
Block a user