Add URL unescaping for tag parameter.

This commit is contained in:
2025-05-17 12:23:01 +08:00
parent f62a92a648
commit e37c543440
2 changed files with 5 additions and 6 deletions

View File

@@ -216,12 +216,6 @@ class UploadingManager extends Listenable {
return this.tasks return this.tasks
} }
removeTask(task: UploadingTask) {
task.cancel();
task.removeListener(this.onTaskStatusChanged);
this.tasks = this.tasks.filter(t => t !== task);
}
hasTasks() { hasTasks() {
return this.tasks.length > 0; return this.tasks.length > 0;
} }

View File

@@ -2,6 +2,7 @@ package api
import ( import (
"encoding/json" "encoding/json"
"net/url"
"nysoure/server/model" "nysoure/server/model"
"nysoure/server/service" "nysoure/server/service"
"strconv" "strconv"
@@ -104,6 +105,10 @@ func handleListResourcesWithTag(c fiber.Ctx) error {
if tag == "" { if tag == "" {
return model.NewRequestError("Tag is required") return model.NewRequestError("Tag is required")
} }
tag, err := url.PathUnescape(tag)
if err != nil {
return model.NewRequestError("Invalid tag")
}
pageStr := c.Query("page") pageStr := c.Query("page")
if pageStr == "" { if pageStr == "" {
pageStr = "1" pageStr = "1"