Don't expect double-encoded values here
This commit is contained in:
parent
04d714f19c
commit
73f1399e47
|
@ -22,14 +22,7 @@ import (
|
||||||
// Returns the contents of a file on the server.
|
// Returns the contents of a file on the server.
|
||||||
func getServerFileContents(c *gin.Context) {
|
func getServerFileContents(c *gin.Context) {
|
||||||
s := GetServer(c.Param("server"))
|
s := GetServer(c.Param("server"))
|
||||||
|
p := "/" + strings.TrimLeft(c.Query("file"), "/")
|
||||||
p, err := url.QueryUnescape(c.Query("file"))
|
|
||||||
if err != nil {
|
|
||||||
TrackedServerError(err, s).AbortWithServerError(c)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
p = "/" + strings.TrimLeft(p, "/")
|
|
||||||
|
|
||||||
st, err := s.Filesystem().Stat(p)
|
st, err := s.Filesystem().Stat(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
TrackedServerError(err, s).AbortFilesystemError(c)
|
TrackedServerError(err, s).AbortFilesystemError(c)
|
||||||
|
@ -65,13 +58,7 @@ func getServerFileContents(c *gin.Context) {
|
||||||
func getServerListDirectory(c *gin.Context) {
|
func getServerListDirectory(c *gin.Context) {
|
||||||
s := GetServer(c.Param("server"))
|
s := GetServer(c.Param("server"))
|
||||||
|
|
||||||
d, err := url.QueryUnescape(c.Query("directory"))
|
stats, err := s.Filesystem().ListDirectory(c.Query("directory"))
|
||||||
if err != nil {
|
|
||||||
TrackedServerError(err, s).AbortWithServerError(c)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
stats, err := s.Filesystem().ListDirectory(d)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
TrackedServerError(err, s).AbortFilesystemError(c)
|
TrackedServerError(err, s).AbortFilesystemError(c)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user