mirror of
https://github.com/restic/restic.git
synced 2026-11-22 05:14:23 +00:00
Update dependencies
This commit is contained in:
1 parent
c7762453cf
commit
ca8c3b4fd5
286 files changed
+28157
-15885
No files matched your search
+10
-1
@@ -121,7 +121,16 @@ func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marsha
|
||||
|
||||
handleForwardResponseServerMetadata(w, mux, md)
|
||||
handleForwardResponseTrailerHeader(w, md)
|
||||
w.Header().Set("Content-Type", marshaler.ContentType())
|
||||
|
||||
contentType := marshaler.ContentType()
|
||||
// Check marshaler on run time in order to keep backwards compatability
|
||||
// An interface param needs to be added to the ContentType() function on
|
||||
// the Marshal interface to be able to remove this check
|
||||
if httpBodyMarshaler, ok := marshaler.(*HTTPBodyMarshaler); ok {
|
||||
contentType = httpBodyMarshaler.ContentTypeFromMessage(resp)
|
||||
}
|
||||
w.Header().Set("Content-Type", contentType)
|
||||
|
||||
if err := handleForwardResponseOptions(ctx, w, resp, opts); err != nil {
|
||||
HTTPError(ctx, mux, marshaler, w, req, err)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user