UNPKG

@softchef/cdk-iot-device-management

Version:

IoT device management is composed of things, thing types, thing groups, jobs, files API services. The constructs can be used independently, that are based on full-managed service to create an API Gateway & Lambda function.

22 lines (21 loc) 804 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.moveHeadersToQuery = void 0; const cloneRequest_1 = require("./cloneRequest"); const moveHeadersToQuery = (request, options = {}) => { var _a; const { headers, query = {} } = typeof request.clone === "function" ? request.clone() : cloneRequest_1.cloneRequest(request); for (const name of Object.keys(headers)) { const lname = name.toLowerCase(); if (lname.substr(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) === null || _a === void 0 ? void 0 : _a.has(lname))) { query[name] = headers[name]; delete headers[name]; } } return { ...request, headers, query, }; }; exports.moveHeadersToQuery = moveHeadersToQuery;