Socket
Socket
Sign inDemoInstall

@aws-sdk/fetch-http-handler

Package Overview
Dependencies
8
Maintainers
5
Versions
131
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.342.0 to 3.347.0

22

dist-cjs/fetch-http-handler.js

@@ -20,2 +20,3 @@ "use strict";

async handle(request, { abortSignal } = {}) {
var _a, _b;
if (!this.config) {

@@ -31,10 +32,17 @@ this.config = await this.configProvider;

let path = request.path;
if (request.query) {
const queryString = (0, querystring_builder_1.buildQueryString)(request.query);
if (queryString) {
path += `?${queryString}`;
}
const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {});
if (queryString) {
path += `?${queryString}`;
}
if (request.fragment) {
path += `#${request.fragment}`;
}
let auth = "";
if (request.username != null || request.password != null) {
const username = (_a = request.username) !== null && _a !== void 0 ? _a : "";
const password = (_b = request.password) !== null && _b !== void 0 ? _b : "";
auth = `${username}:${password}@`;
}
const { port, method } = request;
const url = `${request.protocol}//${request.hostname}${port ? `:${port}` : ""}${path}`;
const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`;
const body = method === "GET" || method === "HEAD" ? undefined : request.body;

@@ -62,2 +70,3 @@ const requestOptions = {

headers: transformedHeaders,
reason: response.statusText,
statusCode: response.status,

@@ -71,2 +80,3 @@ body,

headers: transformedHeaders,
reason: response.statusText,
statusCode: response.status,

@@ -73,0 +83,0 @@ body: response.body,

@@ -27,10 +27,17 @@ import { HttpResponse } from "@aws-sdk/protocol-http";

let path = request.path;
if (request.query) {
const queryString = buildQueryString(request.query);
if (queryString) {
path += `?${queryString}`;
}
const queryString = buildQueryString(request.query || {});
if (queryString) {
path += `?${queryString}`;
}
if (request.fragment) {
path += `#${request.fragment}`;
}
let auth = "";
if (request.username != null || request.password != null) {
const username = request.username ?? "";
const password = request.password ?? "";
auth = `${username}:${password}@`;
}
const { port, method } = request;
const url = `${request.protocol}//${request.hostname}${port ? `:${port}` : ""}${path}`;
const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`;
const body = method === "GET" || method === "HEAD" ? undefined : request.body;

@@ -58,2 +65,3 @@ const requestOptions = {

headers: transformedHeaders,
reason: response.statusText,
statusCode: response.status,

@@ -67,2 +75,3 @@ body,

headers: transformedHeaders,
reason: response.statusText,
statusCode: response.status,

@@ -69,0 +78,0 @@ body: response.body,

{
"name": "@aws-sdk/fetch-http-handler",
"version": "3.342.0",
"version": "3.347.0",
"description": "Provides a way to make requests",

@@ -25,5 +25,5 @@ "scripts": {

"dependencies": {
"@aws-sdk/protocol-http": "3.342.0",
"@aws-sdk/querystring-builder": "3.342.0",
"@aws-sdk/types": "3.342.0",
"@aws-sdk/protocol-http": "3.347.0",
"@aws-sdk/querystring-builder": "3.347.0",
"@aws-sdk/types": "3.347.0",
"@aws-sdk/util-base64": "3.310.0",

@@ -33,3 +33,3 @@ "tslib": "^2.5.0"

"devDependencies": {
"@aws-sdk/abort-controller": "3.342.0",
"@aws-sdk/abort-controller": "3.347.0",
"@tsconfig/recommended": "1.0.1",

@@ -36,0 +36,0 @@ "concurrently": "7.0.0",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc