Log dumped filename

This commit is contained in:
2024-01-17 23:20:06 -06:00
parent 52b069eb12
commit ddfdd8cc17

View File

@@ -277,6 +277,7 @@ func GuessExtension(contentType string) string {
}
return ""
}
// DumpResponse dumps a response body to a file for debugging purposes
func DumpResponse(res *http.Response) {
contentType := res.Header.Get("Content-Type")
@@ -297,4 +298,6 @@ func DumpResponse(res *http.Response) {
log.Err(err).Msg("Error copying response body")
return
}
log.Info().Str("filename", filename).Str("content-type", contentType).Msg("Dumped response body")
}