Question: Here is the version in firefox development:

![enter image description here](https://i.stack.imgur.com/mgnr3.png)

And here is the screencopy in real mobile :

![enter image description here](https://i.stack.imgur.com/qhC7E.jpg)

(Notice that the animated gif above the girl's picture is fine)

Here is the css :

```
    .img_mobile {
        margin:auto;
        width: 100%; 
        max-width: 100%; 
        height: auto;
    }

#conteneur {
 display:flex;
 flex-direction: row;
 justify-content: center;
}

```

And here is part of HTML :

```
<div class="img_mobile" id="conteneur">
        <img src="{% static 'img/home/img-mobile-01.jpg'  %}?{{ git_last_commit }}" alt="">
        <img src="{% static 'img/home/animation-image-1.gif'  %}?{{ git_last_commit }}" alt="" style="position:absolute; mix-blend-mode: screen;">
    </div>

```

2 questions :

1. What should I do to resolve this issue?
2. How can I see this mistake in development?

Thanks for the help

Answer: 
It looks like there are 2 separate problems:

* When you call `response.setEncoding('utf8')`, node automatically converts the incoming data into strings. This means that the `data` event fires with strings, not `Buffer`s.

This means you either need to keep the stream in binary mode (by not calling `setEncoding`), keep the array of buffers, and then concatenate and convert them to a string at the end.

```
response.on('end', function() {
  try {
    var responseString = Buffer.concat(responseBuffer).toString('utf8');
    resolve(JSON.parse(responseString));
  } catch(ex) {
    reject(ex);
  }
});

```

...or keep the `setEncoding` call and do simple string concatenation.

```
response.on('data', function(str) {
  responseString += str;
});

```

I recommend the former for better performance (node has to do some internal buffering to deal with multibyte characters in streaming mode).
* The API you're using is returning a 406 (*Not Acceptable*). This likely means you must supply an `Accept` header in your request.
Based on the following doc, Buffer.concat needs `List of Buffer or Uint8Array` as parameter

<https://nodejs.org/api/buffer.html#buffer_class_method_buffer_concat_list_totallength>

You can try something like the following to convert the string to buffer before push it to your array.

```
response.on('data', function(d) {
    responseBuffer.push(Buffer.from(d, 'utf8'));
});

```

Check the detailed issue here 

<https://github.com/nodejs/node/issues/4949>

Hope it helps