From ba3bc2eb2d502c63d65fbd18ba9974c3faa162f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Pollak?= Date: Fri, 8 Dec 2023 11:21:36 -0300 Subject: [PATCH] Syntax and header --- lib/needle.js | 7 +++---- test/errors_spec.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/needle.js b/lib/needle.js index 5d0e91355..44e6b9265 100644 --- a/lib/needle.js +++ b/lib/needle.js @@ -1,7 +1,7 @@ ////////////////////////////////////////// // Needle -- HTTP Client for Node.js // Written by Tomás Pollak -// (c) 2012-2020 - Fork Ltd. +// (c) 2012-2023 - Fork Ltd. // MIT Licensed ////////////////////////////////////////// @@ -780,12 +780,11 @@ Needle.prototype.send_request = function(count, method, uri, config, post_data, request.end(); } - // Manage the abort signal - if (signal) { + if (signal) { // abort signal given, so handle it if (signal.aborted === true) { abort_handler(); } else { - signal.addEventListener('abort', abort_handler, {once: true}); + signal.addEventListener('abort', abort_handler, { once: true }); } } diff --git a/test/errors_spec.js b/test/errors_spec.js index 1c1cb04a2..4a9acc755 100644 --- a/test/errors_spec.js +++ b/test/errors_spec.js @@ -372,7 +372,7 @@ describe('errors', function() { needle.get(url, { timeout: 300 }, cb); needle.get(url, { timeout: 350 }, cb); - needle.get(url, { timeout: 400}, cb); + needle.get(url, { timeout: 400 }, cb); function abort() { cancel.abort();