Skip to content

Commit

Permalink
url service - create proper URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Sep 6, 2019
1 parent 9414b7e commit 0739b0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vs/platform/url/node/urlService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import { AbstractURLService } from 'vs/platform/url/common/urlService';
export class URLService extends AbstractURLService {

create(options?: Partial<UriComponents>): URI {
const { authority, path, query, fragment } = options ? options : { authority: undefined, path: undefined, query: undefined, fragment: undefined };
let { authority, path, query, fragment } = options ? options : { authority: undefined, path: undefined, query: undefined, fragment: undefined };

if (authority && path && path.indexOf('/') !== 0) {
path = `/${path}`; // URI validation requires a path if there is an authority
}

return URI.from({ scheme: product.urlProtocol, authority, path, query, fragment });
}
Expand Down

0 comments on commit 0739b0f

Please sign in to comment.