Skip to content

Commit

Permalink
Added default port for implicit FTPS (#20603)
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisNikulin5 authored Oct 29, 2024
1 parent 4bf61e2 commit 42b37cc
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 19 deletions.
10 changes: 9 additions & 1 deletion Tasks/FtpUploadV2/ftpuploadtask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,18 @@ function getAccessOption(options: FtpOptions): ftp.AccessOptions {

const hostName: string = options.serverEndpointUrl.hostname!;
const portStr: string = options.serverEndpointUrl.port!;
let port: number = 21;
let port: number;

if (portStr) {
// port not explicitly specified, use default
port = parseInt(portStr);
} else if (secure === "implicit") {
// port for implicit FTPS
port = 990;
}
else {
// port for FTP and explicit FTPS
port = 21;
}

console.log(tl.loc("ConnectPort", hostName, port));
Expand Down
2 changes: 1 addition & 1 deletion Tasks/FtpUploadV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 246,
"Minor": 248,
"Patch": 0
},
"minimumAgentVersion": "2.182.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/FtpUploadV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 246,
"Minor": 248,
"Patch": 0
},
"minimumAgentVersion": "2.182.1",
Expand Down
4 changes: 2 additions & 2 deletions _generated/FtpUploadV2.versionmap.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Default|2.246.0
Node20-225|2.246.1
Default|2.248.0
Node20-225|2.248.1
10 changes: 9 additions & 1 deletion _generated/FtpUploadV2/ftpuploadtask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,18 @@ function getAccessOption(options: FtpOptions): ftp.AccessOptions {

const hostName: string = options.serverEndpointUrl.hostname!;
const portStr: string = options.serverEndpointUrl.port!;
let port: number = 21;
let port: number;

if (portStr) {
// port not explicitly specified, use default
port = parseInt(portStr);
} else if (secure === "implicit") {
// port for implicit FTPS
port = 990;
}
else {
// port for FTP and explicit FTPS
port = 21;
}

console.log(tl.loc("ConnectPort", hostName, port));
Expand Down
6 changes: 3 additions & 3 deletions _generated/FtpUploadV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 246,
"Minor": 248,
"Patch": 0
},
"minimumAgentVersion": "2.182.1",
Expand Down Expand Up @@ -216,7 +216,7 @@
"UploadFailed": "Ftp Upload failed"
},
"_buildConfigMapping": {
"Default": "2.246.0",
"Node20-225": "2.246.1"
"Default": "2.248.0",
"Node20-225": "2.248.1"
}
}
6 changes: 3 additions & 3 deletions _generated/FtpUploadV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 246,
"Minor": 248,
"Patch": 0
},
"minimumAgentVersion": "2.182.1",
Expand Down Expand Up @@ -216,7 +216,7 @@
"UploadFailed": "ms-resource:loc.messages.UploadFailed"
},
"_buildConfigMapping": {
"Default": "2.246.0",
"Node20-225": "2.246.1"
"Default": "2.248.0",
"Node20-225": "2.248.1"
}
}
10 changes: 9 additions & 1 deletion _generated/FtpUploadV2_Node20/ftpuploadtask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,18 @@ function getAccessOption(options: FtpOptions): ftp.AccessOptions {

const hostName: string = options.serverEndpointUrl.hostname!;
const portStr: string = options.serverEndpointUrl.port!;
let port: number = 21;
let port: number;

if (portStr) {
// port not explicitly specified, use default
port = parseInt(portStr);
} else if (secure === "implicit") {
// port for implicit FTPS
port = 990;
}
else {
// port for FTP and explicit FTPS
port = 21;
}

console.log(tl.loc("ConnectPort", hostName, port));
Expand Down
6 changes: 3 additions & 3 deletions _generated/FtpUploadV2_Node20/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 246,
"Minor": 248,
"Patch": 1
},
"minimumAgentVersion": "2.182.1",
Expand Down Expand Up @@ -220,7 +220,7 @@
"UploadFailed": "Ftp Upload failed"
},
"_buildConfigMapping": {
"Default": "2.246.0",
"Node20-225": "2.246.1"
"Default": "2.248.0",
"Node20-225": "2.248.1"
}
}
6 changes: 3 additions & 3 deletions _generated/FtpUploadV2_Node20/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 246,
"Minor": 248,
"Patch": 1
},
"minimumAgentVersion": "2.182.1",
Expand Down Expand Up @@ -220,7 +220,7 @@
"UploadFailed": "ms-resource:loc.messages.UploadFailed"
},
"_buildConfigMapping": {
"Default": "2.246.0",
"Node20-225": "2.246.1"
"Default": "2.248.0",
"Node20-225": "2.248.1"
}
}

0 comments on commit 42b37cc

Please sign in to comment.