Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

downloadApp fails when redirect location has funky unicode characters #1

Closed
ghost opened this issue May 6, 2018 · 7 comments
Closed

Comments

@ghost
Copy link

ghost commented May 6, 2018

For CLI 7.1.0 (and presumably all >= 7 versions), the redirect location of the download URL for the iOS app will have unicode characters e.g. é, which is not correctly handled by PGB, and ends up without the correct URL escaped location, which gives you a S3 error on the download.

To reproduce, you'll need to create an IOS app named with and é or the like, and attempt to downloaded via pgb.downloadApp.

I'll have a PR for your consideration up in a bit. You might have better ideas on how to fix, but this seems to address the issue.

@goya
Copy link
Member

goya commented May 9, 2018

do you have a config.xml handy so i can replicate this issue? having trouble getting it to fail.

@mlitwin
Copy link

mlitwin commented May 10, 2018

Sure - here is one lightly redacted. It occurs to me that node version might be part of it:
node -v
v8.2.1

config-downloadbug.txt

@goya
Copy link
Member

goya commented May 10, 2018

yeah still cant reproduce on linux or mac. are you on windows?

To see extra logging add the process as a debug event listerner like below:
index.txt

@mlitwin
Copy link

mlitwin commented May 11, 2018

I'm on a Mac - 10.13.4. Node is v 8.2.1
Here's the output of a simple download - note the weird characters in the redirect location.

GET https://build.phonegap.com/api/v1/apps/3095327/ios GET https://build.phonegap.com/api/v1/apps/3095327/ios -> 302 http://s3.amazonaws.com/ios.phonegap/production/apps/faa87714-36e7-11e8-9004-0e4497a7784c/Sécurisé.ipa GET http://s3.amazonaws.com/ios.phonegap/production/apps/faa87714-36e7-11e8-9004-0e4497a7784c/Sécurisé.ipa GET http://s3.amazonaws.com/ios.phonegap/production/apps/faa87714-36e7-11e8-9004-0e4497a7784c/Sécurisé.ipa -> 403 { Error: <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>17E757836B5D512E</RequestId><HostId>jgxo4AmUzju+3DJdhXlHAjxACavnPwnR4yDPkSxox42e6ty73MxtvYfTs/8TDB+cG/13s3hr3Bw=</HostId></Error> at IncomingMessage.s.once (/Users/mlitwin/Hesperian/hesperianit/PGBTest/node_modules/pgb-api/index.js:1:5394) at Object.onceWrapper (events.js:314:30) at emitNone (events.js:110:20) at IncomingMessage.emit (events.js:207:7) at endReadableNT (_stream_readable.js:1045:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9) statusCode: 403 }

@mlitwin
Copy link

mlitwin commented May 11, 2018

@goya
Copy link
Member

goya commented May 11, 2018

ok it was PhoneGap Build that was sending a bad location header for api download requests which should be ascii encoded.

deployed a fix for that on the server so it should be fine now.

@goya goya closed this as completed May 11, 2018
@mlitwin
Copy link

mlitwin commented May 12, 2018

Yep confirmed thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants