diff --git a/.travis.yml b/.travis.yml index fd301d7a3..8423b963b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: node_js node_js: + - '13' - '12' - '10' after_success: diff --git a/source/request-as-event-emitter.ts b/source/request-as-event-emitter.ts index 43589c043..4c938da55 100644 --- a/source/request-as-event-emitter.ts +++ b/source/request-as-event-emitter.ts @@ -127,7 +127,8 @@ export default (options: NormalizedOptions, input?: TransformStream) => { delete typedResponse.fromCache; if (!typedResponse.isFromCache) { - typedResponse.ip = response.connection.remoteAddress; + // @ts-ignore Node typings haven't been updated yet + typedResponse.ip = response.socket.remoteAddress; } const rawCookies = typedResponse.headers['set-cookie']; diff --git a/source/utils/types.ts b/source/utils/types.ts index 50d50b439..927660127 100644 --- a/source/utils/types.ts +++ b/source/utils/types.ts @@ -71,7 +71,7 @@ export interface Response extends http.IncomingMessage { // TODO: The `ResponseLike` type should be properly fixed instead: // https://github.com/sindresorhus/got/pull/827/files#r323633794 export interface ResponseObject extends ResponseLike { - connection: { + socket: { remoteAddress: string; }; }