meliorence / meliorence/react-native-image-gallery
Loading images with headers makes 2 requests and first doesn't have header information
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 717
- Forks
- 298
- PR merge metrics
- No merged PRs in 30d
Description
I was facing an undesired outcome with this module and with the help of Charles Proxy I managed to find out when loading an image like this,
{
source: {
uri: 'http://webapitest/api/ReferenceArchive/GetImage/6126e75e-3303-4f25-ac63-0e8e51541572',
headers: {
'MobilePlatformId': '1',
'ApplicationId': '1',
'Version': '2.0.0',
'Token': 'where_s_waldo'
}
}
}
the module makes two requests and the first one always fails because header information is not present. Here's a screenshot of Charles. There's just one image in the array.
This is the first request,
curl -H "Host: webapitest" -H "Accept: /" -H "User-Agent: Demo/1 CFNetwork/893.14 Darwin/16.7.0" -H "Accept-Language: en-us" --compressed http://webapitest/api/ReferenceArchive/GetImage/6126e75e-3303-4f25-ac63-0e8e51541572
And here's the second,
curl -H "Host: webapitest" -H "MobilePlatformId: 1" -H "ApplicationId: 1" -H "Accept: /" -H "Version: 2.0.0" -H "Accept-Language: en-us" -H "Token: where_s_waldo" -H "User-Agent: Demo/1 CFNetwork/893.14 Darwin/16.7.0" --compressed http://webapitest/api/ReferenceArchive/GetImage/6126e75e-3303-4f25-ac63-0e8e51541572
Despite second request being successful the Gallery still shows image loading failed message.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the supplied image source and headers while inspecting the module's image-loading path. Done means the image request includes the headers on its first request, does not make an unnecessary second request, and the gallery displays the image successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100