1
mirror of https://github.com/rclone/rclone synced 2024-11-21 22:50:16 +01:00

googlephotos: don't put an image in error message - fixes #4144

For a certain class of broken or missing image Google Photos puts an
image in the error message.

Before this fix we blindly chucked it into the error message.

After this fix we replace it with some sensible text.
This commit is contained in:
Nick Craig-Wood 2020-04-24 17:51:13 +01:00
parent 8e91f83174
commit 551a829eba

View File

@ -235,6 +235,10 @@ func errorHandler(resp *http.Response) error {
if err != nil {
body = nil
}
// Google sends 404 messages as images so be prepared for that
if strings.HasPrefix(resp.Header.Get("Content-Type"), "image/") {
body = []byte("Image not found or broken")
}
var e = api.Error{
Details: api.ErrorDetails{
Code: resp.StatusCode,