Skip to content

Commit 46822c9

Browse files
committed
bugfix: query params fix
1 parent 6fec818 commit 46822c9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cmd/goatak_server/marti_api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func (app *App) uploadMultipart(ctx *fiber.Ctx, uid, hash, filename string, pack
290290
SubmissionUser: user.GetLogin(),
291291
PrimaryKey: 0,
292292
Hash: hash,
293-
CreatorUID: getStringParamIgnoreCaps(ctx, "creatorUid"),
293+
CreatorUID: queryIgnoreCase(ctx, "creatorUid"),
294294
Scope: user.GetScope(),
295295
Name: filename,
296296
Tool: "",
@@ -329,7 +329,7 @@ func (app *App) uploadFile(ctx *fiber.Ctx, uid, filename string) (*pm.PackageInf
329329
SubmissionUser: user.GetLogin(),
330330
PrimaryKey: 0,
331331
Hash: "",
332-
CreatorUID: getStringParamIgnoreCaps(ctx, "creatorUid"),
332+
CreatorUID: queryIgnoreCase(ctx, "creatorUid"),
333333
Scope: user.GetScope(),
334334
Name: filename,
335335
Tool: "",
@@ -500,7 +500,7 @@ func getAllGroupsCacheHandler(_ *App) fiber.Handler {
500500
func getProfileConnectionHandler(app *App) fiber.Handler {
501501
return func(ctx *fiber.Ctx) error {
502502
username := Username(ctx)
503-
uid := getStringParamIgnoreCaps(ctx, "clientUid")
503+
uid := queryIgnoreCase(ctx, "clientUid")
504504

505505
files := app.GetProfileFiles(username, uid)
506506
if len(files) == 0 {

cmd/goatak_server/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ func logParams(log *slog.Logger, ctx *fiber.Ctx) {
1717
log.Info("params: " + strings.Join(params, ","))
1818
}
1919

20-
func getStringParamIgnoreCaps(c *fiber.Ctx, name string) string {
20+
func queryIgnoreCase(c *fiber.Ctx, name string) string {
2121
nn := strings.ToLower(name)
22-
for k, v := range c.AllParams() {
22+
for k, v := range c.Queries() {
2323
if strings.ToLower(k) == nn {
2424
return v
2525
}

0 commit comments

Comments
 (0)