Set default namespace for necessary structs (#8903)

This commit is contained in:
Ashish Kumar Sinha
2020-01-29 10:19:38 +05:30
committed by GitHub
parent 0414f01b6e
commit 5bd0e95eef
5 changed files with 98 additions and 113 deletions

View File

@@ -84,7 +84,6 @@ func (api objectAPIHandlers) GetBucketNotificationHandler(w http.ResponseWriter,
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
return
}
config.XMLNS = "http://s3.amazonaws.com/doc/2006-03-01/"
config.SetRegion(globalServerRegion)
notificationBytes, err := xml.Marshal(config)
if err != nil {
@@ -127,11 +126,6 @@ func (api objectAPIHandlers) GetBucketNotificationHandler(w http.ResponseWriter,
}
}
// If xml namespace is empty, set a default value before returning.
if config.XMLNS == "" {
config.XMLNS = "http://s3.amazonaws.com/doc/2006-03-01/"
}
notificationBytes, err := xml.Marshal(config)
if err != nil {
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))