function getCanonicalizedHeadersString(request) {
        let headersArray = [];
        for (const [name, value] of request.headers) {
            if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) {
                headersArray.push({ name, value });
            }
        }
        headersArray.sort((a, b) => {
            return compareHeader(a.name.toLowerCase(), b.name.toLowerCase());
        });
        // Remove duplicate headers
        headersArray = headersArray.filter((value, index, array) => {
            if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) {
                return false;
            }
            return true;
        });
        let canonicalizedHeadersStringToSign = "";
        headersArray.forEach((header) => {
            canonicalizedHeadersStringToSign += `${header.name
                .toLowerCase()
                .trimRight()}:${header.value.trimLeft()}\n`;
        });
        return canonicalizedHeadersStringToSign;
    }
To construct the CanonicalizedHeaders portion of the signature string, follow these steps:
1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header.
2. Convert each HTTP header name to lowercase.
3. Sort the headers lexicographically by header name, in ascending order.
   Each header may appear only once in the string.
4. Replace any linear whitespace in the header value with a single space.
5. Trim any whitespace around the colon in the header.
6. Finally, append a new-line character to each canonicalized header in the resulting list.
   Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string.