query unescape more routes

fixes #447. Went through all routes with components in the path to check
if they needed escaping, quite a few did.
This commit is contained in:
Harvey Tindall
2025-12-06 20:04:30 +00:00
parent e5315095be
commit fcfd5f4981
4 changed files with 40 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"net/url"
"time"
"github.com/gin-gonic/gin"
@@ -584,8 +585,9 @@ func (app *appContext) MatrixConnect(gc *gin.Context) {
// @Security Bearer
// @tags Other
func (app *appContext) DiscordGetUsers(gc *gin.Context) {
name := gc.Param("username")
if name == "" {
escapedName := gc.Param("username")
name, err := url.QueryUnescape(escapedName)
if err != nil || name == "" {
respondBool(400, false, gc)
return
}