mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
POSTForm: Return http 303 if redirect is specified (#3479)
success_action_redirect in the sent Form means that the server needs to return 303 in addition to a well specific redirection url, this commit adds this feature
This commit is contained in:
committed by
Harshavardhana
parent
faa6b1e925
commit
d8e4d3c9c8
@@ -492,17 +492,23 @@ func writeResponse(w http.ResponseWriter, statusCode int, response []byte) {
|
||||
w.(http.Flusher).Flush()
|
||||
}
|
||||
|
||||
// writeSuccessResponse write success headers and response if any.
|
||||
// writeSuccessResponse writes success headers and response if any.
|
||||
func writeSuccessResponse(w http.ResponseWriter, response []byte) {
|
||||
writeResponse(w, http.StatusOK, response)
|
||||
}
|
||||
|
||||
// writeSuccessNoContent write success headers with http status 204
|
||||
// writeSuccessNoContent writes success headers with http status 204
|
||||
func writeSuccessNoContent(w http.ResponseWriter) {
|
||||
writeResponse(w, http.StatusNoContent, nil)
|
||||
}
|
||||
|
||||
// writeErrorRespone write error headers
|
||||
// writeRedirectSeeOther writes Location header with http status 303
|
||||
func writeRedirectSeeOther(w http.ResponseWriter, location string) {
|
||||
w.Header().Set("Location", location)
|
||||
writeResponse(w, http.StatusSeeOther, nil)
|
||||
}
|
||||
|
||||
// writeErrorRespone writes error headers
|
||||
func writeErrorResponse(w http.ResponseWriter, req *http.Request, errorCode APIErrorCode, resource string) {
|
||||
apiError := getAPIError(errorCode)
|
||||
// set common headers
|
||||
|
||||
Reference in New Issue
Block a user