Skip to content

Commit

Permalink
[short url] use url.format when creating /goto link
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Mar 21, 2016
1 parent a8c1305 commit 2a71673
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui/public/share/lib/url_shortener.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export default function createUrlShortener(Notifier, $http, $location) {
const formData = { url: relativeUrl };

return $http.post(`${basePath}/shorten`, formData).then((result) => {
return `${parsedUrl.protocol}//${parsedUrl.host}${basePath}/goto/${result.data}`;
return url.format({
protocol: parsedUrl.protocol,
host: parsedUrl.host,
pathname: `${basePath}/goto/${result.data}`
});
}).catch((response) => {
notify.error(response);
});
Expand Down

0 comments on commit 2a71673

Please sign in to comment.