File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ export async function createSftpConnection(config: SftpConnectionConfig): Promis
104104 throw new Error ( hostValidation . error )
105105 }
106106
107+ const resolvedHost = hostValidation . resolvedIP ?? host . trim ( )
108+
107109 return new Promise ( ( resolve , reject ) => {
108110 const client = new Client ( )
109111 const port = config . port || 22
@@ -117,7 +119,7 @@ export async function createSftpConnection(config: SftpConnectionConfig): Promis
117119 }
118120
119121 const connectConfig : ConnectConfig = {
120- host : host . trim ( ) ,
122+ host : resolvedHost ,
121123 port,
122124 username : config . username ,
123125 }
Original file line number Diff line number Diff line change @@ -121,6 +121,8 @@ export async function createSSHConnection(config: SSHConnectionConfig): Promise<
121121 throw new Error ( hostValidation . error )
122122 }
123123
124+ const resolvedHost = hostValidation . resolvedIP ?? host . trim ( )
125+
124126 return new Promise ( ( resolve , reject ) => {
125127 const client = new Client ( )
126128 const port = config . port || 22
@@ -134,7 +136,7 @@ export async function createSSHConnection(config: SSHConnectionConfig): Promise<
134136 }
135137
136138 const connectConfig : ConnectConfig = {
137- host : host . trim ( ) ,
139+ host : resolvedHost ,
138140 port,
139141 username : config . username ,
140142 }
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const BEARER_PREFIX = 'Bearer '
2525export function hasExternalApiCredentials ( headers : Headers ) : boolean {
2626 if ( headers . has ( API_KEY_HEADER ) ) return true
2727 const auth = headers . get ( 'authorization' )
28- return auth ? .startsWith ( BEARER_PREFIX )
28+ return auth !== null && auth . startsWith ( BEARER_PREFIX )
2929}
3030
3131export interface AuthResult {
You can’t perform that action at this time.
0 commit comments