Socket
Socket
Sign inDemoInstall

@trivikr-test/node-http-handler

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trivikr-test/node-http-handler - npm Package Compare versions

Comparing version 3.52.0 to 3.55.0

10

dist-cjs/node-http-handler.js

@@ -56,3 +56,3 @@ "use strict";

const isSSL = request.protocol === "https:";
const queryString = querystring_builder_1.buildQueryString(request.query || {});
const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {});
const nodeHttpsOptions = {

@@ -70,3 +70,3 @@ headers: request.headers,

statusCode: res.statusCode || -1,
headers: get_transformed_headers_1.getTransformedHeaders(res.headers),
headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers),
body: res,

@@ -84,4 +84,4 @@ });

});
set_connection_timeout_1.setConnectionTimeout(req, reject, this.config.connectionTimeout);
set_socket_timeout_1.setSocketTimeout(req, reject, this.config.socketTimeout);
(0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout);
(0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.socketTimeout);
if (abortSignal) {

@@ -95,3 +95,3 @@ abortSignal.onabort = () => {

}
write_request_body_1.writeRequestBody(req, request);
(0, write_request_body_1.writeRequestBody)(req, request);
});

@@ -98,0 +98,0 @@ }

@@ -43,3 +43,3 @@ "use strict";

};
const queryString = querystring_builder_1.buildQueryString(query || {});
const queryString = (0, querystring_builder_1.buildQueryString)(query || {});
const req = session.request({

@@ -53,3 +53,3 @@ ...request.headers,

statusCode: headers[":status"] || -1,
headers: get_transformed_headers_1.getTransformedHeaders(headers),
headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers),
body: req,

@@ -96,3 +96,3 @@ });

});
write_request_body_1.writeRequestBody(req, request);
(0, write_request_body_1.writeRequestBody)(req, request);
});

@@ -105,3 +105,3 @@ }

return existingSessions[0];
const newSession = http2_1.connect(authority);
const newSession = (0, http2_1.connect)(authority);
const destroySessionCb = () => {

@@ -108,0 +108,0 @@ this.destroySession(newSession);

@@ -10,3 +10,3 @@ "use strict";

const stream_1 = require("stream");
const fixturesDir = path_1.join(__dirname, "..", "fixtures");
const fixturesDir = (0, path_1.join)(__dirname, "..", "fixtures");
const setResponseHeaders = (response, headers) => {

@@ -40,3 +40,3 @@ for (const [key, value] of Object.entries(headers)) {

setTimeout(() => {
exports.createResponseFunction(httpResp)(request, response);
(0, exports.createResponseFunction)(httpResp)(request, response);
}, 100);

@@ -46,5 +46,5 @@ };

const createMockHttpsServer = () => {
const server = https_1.createServer({
key: fs_1.readFileSync(path_1.join(fixturesDir, "test-server-key.pem")),
cert: fs_1.readFileSync(path_1.join(fixturesDir, "test-server-cert.pem")),
const server = (0, https_1.createServer)({
key: (0, fs_1.readFileSync)((0, path_1.join)(fixturesDir, "test-server-key.pem")),
cert: (0, fs_1.readFileSync)((0, path_1.join)(fixturesDir, "test-server-cert.pem")),
});

@@ -55,3 +55,3 @@ return server;

const createMockHttpServer = () => {
const server = http_1.createServer();
const server = (0, http_1.createServer)();
return server;

@@ -61,5 +61,5 @@ };

const createMockHttp2Server = () => {
const server = http2_1.createServer();
const server = (0, http2_1.createServer)();
return server;
};
exports.createMockHttp2Server = createMockHttp2Server;

@@ -78,3 +78,3 @@ import { __awaiter, __generator } from "tslib";

method: request.method,
path: queryString ? request.path + "?" + queryString : request.path,
path: queryString ? "".concat(request.path, "?").concat(queryString) : request.path,
port: request.port,

@@ -81,0 +81,0 @@ agent: isSSL ? _this.config.httpsAgent : _this.config.httpAgent,

@@ -48,3 +48,3 @@ import { __assign, __values } from "tslib";

var hostname = request.hostname, method = request.method, port = request.port, protocol = request.protocol, path = request.path, query = request.query;
var authority = protocol + "//" + hostname + (port ? ":" + port : "");
var authority = "".concat(protocol, "//").concat(hostname).concat(port ? ":".concat(port) : "");
var session = _this.getSession(authority, _this.disableConcurrentStreams || false);

@@ -59,3 +59,3 @@ var reject = function (err) {

var queryString = buildQueryString(query || {});
var req = session.request(__assign(__assign({}, request.headers), (_a = {}, _a[constants.HTTP2_HEADER_PATH] = queryString ? path + "?" + queryString : path, _a[constants.HTTP2_HEADER_METHOD] = method, _a)));
var req = session.request(__assign(__assign({}, request.headers), (_a = {}, _a[constants.HTTP2_HEADER_PATH] = queryString ? "".concat(path, "?").concat(queryString) : path, _a[constants.HTTP2_HEADER_METHOD] = method, _a)));
req.on("response", function (headers) {

@@ -78,3 +78,3 @@ var httpResponse = new HttpResponse({

req.close();
var timeoutError = new Error("Stream timed out because of no activity for " + requestTimeout + " ms");
var timeoutError = new Error("Stream timed out because of no activity for ".concat(requestTimeout, " ms"));
timeoutError.name = "TimeoutError";

@@ -93,7 +93,7 @@ reject(timeoutError);

req.on("frameError", function (type, code, id) {
reject(new Error("Frame type id " + type + " in stream id " + id + " has failed with code " + code + "."));
reject(new Error("Frame type id ".concat(type, " in stream id ").concat(id, " has failed with code ").concat(code, ".")));
});
req.on("error", reject);
req.on("aborted", function () {
reject(new Error("HTTP/2 stream is abnormally aborted in mid-communication with result code " + req.rstCode + "."));
reject(new Error("HTTP/2 stream is abnormally aborted in mid-communication with result code ".concat(req.rstCode, ".")));
});

@@ -100,0 +100,0 @@ req.on("close", function () {

@@ -10,3 +10,3 @@ export var setConnectionTimeout = function (request, reject, timeoutInMs) {

request.destroy();
reject(Object.assign(new Error("Socket timed out without establishing a connection within " + timeoutInMs + " ms"), {
reject(Object.assign(new Error("Socket timed out without establishing a connection within ".concat(timeoutInMs, " ms")), {
name: "TimeoutError",

@@ -13,0 +13,0 @@ }));

@@ -5,4 +5,4 @@ export var setSocketTimeout = function (request, reject, timeoutInMs) {

request.destroy();
reject(Object.assign(new Error("Connection timed out after " + timeoutInMs + " ms"), { name: "TimeoutError" }));
reject(Object.assign(new Error("Connection timed out after ".concat(timeoutInMs, " ms")), { name: "TimeoutError" }));
});
};
{
"name": "@trivikr-test/node-http-handler",
"version": "3.52.0",
"version": "3.55.0",
"description": "Provides a way to make requests",

@@ -24,7 +24,7 @@ "scripts": {

"dependencies": {
"@trivikr-test/abort-controller": "3.52.0",
"@trivikr-test/protocol-http": "3.52.0",
"@trivikr-test/querystring-builder": "3.52.0",
"@trivikr-test/types": "3.52.0",
"tslib": "^2.3.0"
"@trivikr-test/abort-controller": "3.55.0",
"@trivikr-test/protocol-http": "3.55.0",
"@trivikr-test/querystring-builder": "3.55.0",
"@trivikr-test/types": "3.55.0",
"tslib": "^2.3.1"
},

@@ -38,3 +38,3 @@ "devDependencies": {

"typedoc": "0.19.2",
"typescript": "~4.3.5"
"typescript": "~4.6.2"
},

@@ -41,0 +41,0 @@ "jest": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc