vsivsi / meteor-file-collection

Extends Meteor Collections to handle file data using MongoDB gridFS.
http://atmospherejs.com/vsivsi/file-collection
Other
159 stars 37 forks source link

we found a bug that will cause cordova http request fail on production env #131

Closed crapthings closed 8 years ago

crapthings commented 8 years ago

https://github.com/vsivsi/meteor-file-collection/blob/master/src/resumable_client.coffee#L30

url = Meteor.absoluteUrl(url) if Meteor.isCordova

above line produce two slash that you won't make request work on "request handler"

http://www.example.com:3000//gridfs/files/_resumable // failed

somethings should like this

url = Meteor.absoluteUrl(url.replace /^\//, '') if Meteor.isCordova

test on 1.3.4.2 vsivsi 1.3.5

crapthings commented 8 years ago

if you're running dev "meteor run ios-device" all works well, but not production

meteor build ../test // will failed upload
crapthings commented 8 years ago

we spent weeks on this, pls review

crapthings commented 8 years ago

http://docs.meteor.com/api/core.html#Meteor-absoluteUrl

A path to append to the root URL. Do not include a leading "/".
vsivsi commented 8 years ago

I see. One wonders why Meteor doesn't just make .absoluteUrl() do the right thing...

vsivsi commented 8 years ago

Fixed in 1.3.6 on Atmosphere now. Thanks for the PR!