add paritional files uploading for minIO
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func requestValidCheck(response *http.ResponseWriter, request *http.Request) bool {
|
||||
func postValidCheckWithResponseOnFail(response *http.ResponseWriter, request *http.Request) bool {
|
||||
if request.Method != http.MethodPost {
|
||||
http.Error(*response, "POST only", http.StatusMethodNotAllowed)
|
||||
return false
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
func HandleDm(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ func HandleDm(response http.ResponseWriter, request *http.Request) {
|
||||
}
|
||||
|
||||
func HandleUserGetConnectionMessages(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
ctx := request.Context()
|
||||
@@ -162,7 +162,7 @@ func HandleUserGetConnectionMessages(response http.ResponseWriter, request *http
|
||||
}
|
||||
|
||||
func HandleUserNewConnection(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
ctx := request.Context()
|
||||
@@ -221,7 +221,7 @@ func HandleUserNewConnection(response http.ResponseWriter, request *http.Request
|
||||
}
|
||||
|
||||
func HandleUserDeleteConnection(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
ctx := request.Context()
|
||||
@@ -280,7 +280,7 @@ func HandleUserDeleteConnection(response http.ResponseWriter, request *http.Requ
|
||||
}
|
||||
|
||||
func HandleUserElevateConnection(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
ctx := request.Context()
|
||||
@@ -349,7 +349,7 @@ func HandleUserElevateConnection(response http.ResponseWriter, request *http.Req
|
||||
}
|
||||
|
||||
func HandleUserGetConnections(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
ctx := request.Context()
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
func HandleUserNewToken(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ func HandleUserNewToken(response http.ResponseWriter, request *http.Request) {
|
||||
}
|
||||
|
||||
func HandleUserNew(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ func HandleUserNew(response http.ResponseWriter, request *http.Request) {
|
||||
}
|
||||
|
||||
func HandleUserDelete(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
ctx := request.Context()
|
||||
@@ -139,7 +139,7 @@ func HandleUserDelete(response http.ResponseWriter, request *http.Request) {
|
||||
|
||||
// HandleUserModifyAppearance currently just color
|
||||
func HandleUserModifyAppearance(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ func HandleUserModifyAppearance(response http.ResponseWriter, request *http.Requ
|
||||
|
||||
// HandleUserModifyAbout currently just pronouns
|
||||
func HandleUserModifyAbout(response http.ResponseWriter, request *http.Request) {
|
||||
if !requestValidCheck(&response, request) {
|
||||
if !postValidCheckWithResponseOnFail(&response, request) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user