UNPKG

@aws-amplify/core

Version:
20 lines (17 loc) 654 B
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { HttpRequest } from '../../../../../types'; /** * Returns signed headers. * * @param headers `headers` from the request. * @returns List of headers included in canonical headers, separated by semicolons (;). This indicates which headers * are part of the signing process. Header names must use lowercase characters and must appear in alphabetical order. * * @internal */ export const getSignedHeaders = (headers: HttpRequest['headers']): string => Object.keys(headers) .map(key => key.toLowerCase()) .sort() .join(';');