changed endpoints to work as should in first place
This commit is contained in:
@@ -72,7 +72,7 @@ func HandleGetUserAvatar(response http.ResponseWriter, request *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
targetId, err := convertions.ConvertStringUuid(request.FormValue("userid"))
|
||||
targetId, err := convertions.ConvertStringUuid(request.URL.Query().Get("userid"))
|
||||
if err != nil {
|
||||
http.Error(response, "invalid userid", http.StatusBadRequest)
|
||||
return
|
||||
@@ -110,7 +110,7 @@ func HandleGetUserProfileBg(response http.ResponseWriter, request *http.Request)
|
||||
return
|
||||
}
|
||||
|
||||
targetId, err := convertions.ConvertStringUuid(request.FormValue("userid"))
|
||||
targetId, err := convertions.ConvertStringUuid(request.URL.Query().Get("userid"))
|
||||
if err != nil {
|
||||
http.Error(response, "invalid userid", http.StatusBadRequest)
|
||||
return
|
||||
@@ -154,7 +154,7 @@ func HandleAttachmentFileDownload(response http.ResponseWriter, request *http.Re
|
||||
return
|
||||
}
|
||||
|
||||
key := request.FormValue("key")
|
||||
key := request.URL.Query().Get("key")
|
||||
if !strings.HasPrefix(key, conn.Id.String()+"/") {
|
||||
http.Error(response, "no such file", http.StatusUnauthorized)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user