react-native-doc-viewer icon indicating copy to clipboard operation
react-native-doc-viewer copied to clipboard

Support of AWS presigned url format

Open Diwei-Chen opened this issue 6 years ago • 2 comments

Hi there,

I found if there is a % inside a url then the % sign will be changed to %25 everywhere in it.

For example:

URL:

https://xxx.s3.amazonaws.com/acda72b76cb62dbd13c65a8f/ZzDE3KaPiodb4asy2?AWSAccessKeyId=AKIAJK3DYEJEVJ766FMA&Expires=1524730260&Signature=EnVTV05ZHhJZX8TeDVmj05SoPPM%3D

gets changed to

https://xxx.s3.amazonaws.com/acda72b76cb62dbd13c65a8f/ZzDE3KaPiodb4asy2?AWSAccessKeyId=AKIAJK3DYEJEVJ766FMA&Expires=1524730260&Signature=EnVTV05ZHhJZX8TeDVmj05SoPPM%253D

which breaks the signature of the AWS presigned url.

Any plans to support this url format?

Thanks,

Diwei-Chen avatar Apr 19 '18 08:04 Diwei-Chen

Any update on that ? in my case it changes Aws AccessKeyId

bhatti-waqas avatar Jul 04 '18 07:07 bhatti-waqas

Try 'https://xxx.s3.amazonaws.com/acda72b76cb62dbd13c65a8f/ZzDE3KaPiodb4asy2?AWSAccessKeyId=AKIAJK3DYEJEVJ766FMA&Expires=1524730260&Signature=EnVTV05ZHhJZX8TeDVmj05SoPPM='

instead: 'https://xxx.s3.amazonaws.com/acda72b76cb62dbd13c65a8f/ZzDE3KaPiodb4asy2?AWSAccessKeyId=AKIAJK3DYEJEVJ766FMA&Expires=1524730260&Signature=EnVTV05ZHhJZX8TeDVmj05SoPPM%3D'

%3D in UTF code is = sign

Url you sent as strings should be decoded

const urlYou'llSentToOpenFileAsUrlParam = decodeURI(yourUrl);

dmitryou avatar Mar 20 '19 11:03 dmitryou