Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
}

export class APIClient {
authPromise?: Promise<HTTP<any>>

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 62 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 22.x)

Unexpected any. Specify a different type
http: typeof HTTP
preauthPromises: { [k: string]: Promise<HTTP<any>> }

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 64 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 22.x)

Unexpected any. Specify a different type
private _auth?: string
private readonly _login: Login
private _particleboard!: ParticleboardClient
Expand All @@ -78,7 +78,7 @@
const apiUrl = new url.URL(vars.apiUrl)
const envHeaders = JSON.parse(process.env.HEROKU_HEADERS || '{}')
this.preauthPromises = {}
const self = this as any

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 81 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 22.x)

Unexpected any. Specify a different type
const opts = {
headers: {
accept: 'application/vnd.heroku+json; version=3',
Expand Down Expand Up @@ -169,7 +169,7 @@
targetUrl = new URL(url, vars.apiUrl)
}

const isHerokuApi = ALLOWED_HEROKU_DOMAINS.some(domain => targetUrl.hostname.endsWith(`.${domain}`))
const isHerokuApi = ALLOWED_HEROKU_DOMAINS.some(domain => targetUrl.hostname.endsWith(`.${domain}`) || targetUrl.hostname === domain)
const isLocalhost = LOCALHOST_DOMAINS.includes(targetUrl.hostname as (typeof LOCALHOST_DOMAINS)[number])

if (isHerokuApi || isLocalhost) {
Expand Down Expand Up @@ -256,7 +256,7 @@
url: string,
opts: APIClient.Options = {},
retries = 3,
): Promise<APIHTTPClient<any>> {

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 22.x)

Unexpected any. Specify a different type

Check warning on line 259 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 22.x)

Unexpected any. Specify a different type
const app = err.body.app ? err.body.app.name : null
if (!app || !options.preauth) {
opts.headers = opts.headers || {}
Expand Down
2 changes: 1 addition & 1 deletion src/vars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class Vars {
// Remove protocol if present
const cleanHost = host.replace(/^https?:\/\//, '')

return ALLOWED_HEROKU_DOMAINS.some(domain => cleanHost.endsWith(`.${domain}`)) || LOCALHOST_DOMAINS.some(domain => cleanHost.includes(domain))
return ALLOWED_HEROKU_DOMAINS.some(domain => cleanHost.endsWith(`.${domain}`) || cleanHost === domain) || LOCALHOST_DOMAINS.some(domain => cleanHost.includes(domain))
}
}

Expand Down
Loading