bengott/meteor-avatar

Better handling of relative paths for default URLs

Closed this issue · 0 comments

Current code can only detect relative paths that start with '/'
This will not stand, man...

https://github.com/bengott/meteor-avatar/blob/master/export.js#L29-L32

// If it's a relative path, complete the URL (prepend the origin)
if (defaultUrl.charAt(0) === '/' && defaultUrl.charAt(1) !== '/') {
  defaultUrl = location.origin + defaultUrl;
}