mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Add URL unescaping for tag parameter.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
@@ -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"
|
||||||
|
Reference in New Issue
Block a user