Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return url missing '/' - e.g. 'https:/' instead of 'https://' for 0.6.0 #84

Closed
one-giant-leap opened this issue Mar 27, 2015 · 3 comments · Fixed by #85
Closed

Return url missing '/' - e.g. 'https:/' instead of 'https://' for 0.6.0 #84

one-giant-leap opened this issue Mar 27, 2015 · 3 comments · Fixed by #85
Assignees
Labels

Comments

@one-giant-leap
Copy link

The url that is returned when a file has been uploaded (using Amazon S3 in my testing) is missing a '/'.

e.g. 'https:/bucket.s3-us-west-2.amazonaws.com' instead of 'https://bucket.s3-us-west-2.amazonaws.com'.

This issues does not occur in version 0.4.0, but it is present in 0.6.0.

Thanks!

@abhishekbatra
Copy link

The offending line is this. path.join joins and then normalizes, resulting in '//' -> '/'

@abhishekbatra
Copy link

@gsuess Would the following code work as a replacement:

downloadPath = (directive.cdn || bucketUrl) + '/' + payload.key;

Or is the path.join needed for sanitization?

@abhishekbatra
Copy link

Another shamelessly simple solution seems:

downloadPath = path.join((directive.cdn || bucketUrl), payload.key),
downloadPath = downloadPath.replace('/', '//');

abhishekbatra added a commit to abhishekbatra/meteor-slingshot that referenced this issue Mar 28, 2015
@gsuess gsuess self-assigned this Mar 29, 2015
@gsuess gsuess added the bug label Mar 29, 2015
gsuess added a commit that referenced this issue Mar 29, 2015
Do not use NPM path for processing http URLs.
gsuess added a commit that referenced this issue Mar 29, 2015
@gsuess gsuess mentioned this issue Mar 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants