Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Different response headers for same response #584

@parohy

Description

@parohy

Hello!
I run into a strange behavior. I am debugging my app with Charles 4.2. Our backend supports if-modified-since header. I am sending a request with the last-modified date to our image backend. In charless i get status code 304 but when i console.log the status code in app I get 200.
I even have content length but according to Charles I do not download any body.
When I send the request without is-modified-since I have same headers in Charles and in app.

"react-native-fetch-blob": "0.10.8",
"react-native": "0.49.3"

const fetchImage = (url, headers, cached) => (
    RNFetchBlob.config({
        appendExt: 'jpg',
        fileCache: true
    }).fetch('GET', url, headers)
        .then(res => {
            const status = Math.floor(res.info().status);
            //If request fails or not modified return cached path
            if (status !== 200) {
                return cached;
            }
            //If request OK with 200
            const resHead = res.respInfo.headers;
            cacheImage(url, res.path(), resHead['Last-Modified'] || resHead['last-modified']);
            return res.path();
        })
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions