Skip to content

handling trailing slashes in service url #474

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions app/lib/connection.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { BasicCredentialHandler } from "azure-devops-node-api/handlers/basiccreds";

import url = require("url");
import apim = require("azure-devops-node-api/WebApi");
import apibasem = require("azure-devops-node-api/interfaces/common/VsoBaseInterfaces");
import trace = require("./trace");

export class TfsConnection {
private parsedUrl: url.Url;
Expand All @@ -14,7 +9,7 @@ export class TfsConnection {
constructor(private serviceUrl: string) {
this.parsedUrl = url.parse(this.serviceUrl);

var splitPath: string[] = this.parsedUrl.path.split("/").slice(1);
const splitPath: string[] = this.parsedUrl.path.split("/").slice(1).filter(item => item !== "");
this.accountUrl = this.parsedUrl.protocol + "//" + this.parsedUrl.host;

if (splitPath.length === 2 && splitPath[0] === "tfs") {
Expand Down