Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump got from 11.8.3 to 12.0.0 #7370

Merged
merged 14 commits into from Jan 29, 2022
4 changes: 3 additions & 1 deletion core/base-service/auth-helper.js
Expand Up @@ -108,7 +108,9 @@ class AuthHelper {

get _basicAuth() {
const { _user: username, _pass: password } = this
return this.isConfigured ? { username, password } : undefined
return this.isConfigured
? { username: username || '', password: password || '' }
: undefined
}

/*
Expand Down
4 changes: 2 additions & 2 deletions core/base-service/auth-helper.spec.js
Expand Up @@ -107,10 +107,10 @@ describe('AuthHelper', function () {
]).expect({ username: 'admin', password: 'abc123' })
given({ userKey: 'myci_user' }, { myci_user: 'admin' }).expect({
username: 'admin',
password: undefined,
password: '',
})
given({ passKey: 'myci_pass' }, { myci_pass: 'abc123' }).expect({
username: undefined,
username: '',
password: 'abc123',
})
given({ userKey: 'myci_user', passKey: 'myci_pass' }, {}).expect(
Expand Down
6 changes: 3 additions & 3 deletions core/base-service/got.js
@@ -1,4 +1,4 @@
import got from 'got'
import got, { CancelError } from 'got'
import { Inaccessible, InvalidResponse } from './errors.js'
import {
fetchLimitBytes as fetchLimitBytesDefault,
Expand All @@ -10,14 +10,14 @@ const userAgent = getUserAgent()
async function sendRequest(gotWrapper, url, options) {
const gotOptions = Object.assign({}, options)
gotOptions.throwHttpErrors = false
gotOptions.retry = 0
gotOptions.retry = { limit: 0 }
gotOptions.headers = gotOptions.headers || {}
gotOptions.headers['User-Agent'] = userAgent
try {
const resp = await gotWrapper(url, gotOptions)
return { res: resp, buffer: resp.body }
} catch (err) {
if (err instanceof got.CancelError) {
if (err instanceof CancelError) {
throw new InvalidResponse({
underlyingError: new Error('Maximum response size exceeded'),
})
Expand Down
2 changes: 1 addition & 1 deletion core/got-test-client.js
@@ -1,4 +1,4 @@
import got from 'got'

// https://github.com/nock/nock/issues/1523
export default got.extend({ retry: 0 })
export default got.extend({ retry: { limit: 0 } })
2 changes: 1 addition & 1 deletion core/server/influx-metrics.js
Expand Up @@ -16,7 +16,7 @@ export default class InfluxMetrics {
url: this._config.url,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: await this.metrics(),
timeout: this._config.timeoutMillseconds,
timeout: { request: this._config.timeoutMillseconds },
username: this._config.username,
password: this._config.password,
throwHttpErrors: false,
Expand Down
1 change: 1 addition & 0 deletions core/server/influx-metrics.spec.js
Expand Up @@ -5,6 +5,7 @@ import { expect } from 'chai'
import log from './log.js'
import InfluxMetrics from './influx-metrics.js'
import '../register-chai-plugins.spec.js'

describe('Influx metrics', function () {
const metricInstance = {
metrics() {
Expand Down