react-native-auto-height-image icon indicating copy to clipboard operation
react-native-auto-height-image copied to clipboard

passing headers does not work

Open miladrasooli opened this issue 7 years ago • 4 comments
trafficstars

Hello , I tried to pass Authorization header in headers object but it doesn't work, but it works with <Image/> component ,maybe it's a bug?

miladrasooli avatar Oct 17 '18 13:10 miladrasooli

@miladrasooli Please provide more information:

Codes to reproduce the issue:

...

Steps to reproduce the issue:

  1. ...
  2. ...

Expected result: ...

vivaxy avatar Oct 18 '18 02:10 vivaxy

I thought it was self-explanatory, I have image links which need authorization token to open , and I'm using this line of code to do so :

<AutoHeightImage source={{uri:'.............',headers:{Authorization:'...............'}}}/>

Unfortunately it doesn't work. When I change AutoHeightImage to Image it works.

miladrasooli avatar Oct 18 '18 05:10 miladrasooli

Currently, react-native-auto-height-image rely on Image.getSize API.

source prop supports method, headers and body. See.

Image.getSize API does not work with method, headers and body params. See.

In future, maybe we will replace Image.getSize with fetch.

vivaxy avatar Oct 18 '18 05:10 vivaxy

Thanks , Good to know , I hope it'll be added in next releases

miladrasooli avatar Oct 18 '18 06:10 miladrasooli