src/net/authV2.js
/**
     * Compute the canonical HTTP header names to include in the signature.
     * 
     * @returns {string[]} the sorted, lower-cased HTTP header names to include
     */
Compute the canonical HTTP header names to include in the signature.

@returns {string[]} the sorted, lower-cased HTTP header names to include
Compute the canonical HTTP header names to include in the signature . @returns { string [] } the sorted lower - cased HTTP header names to include
canonicalHeaderNames() {
        const httpHeaders = this.httpHeaders;
        const signedHeaderNames = this.signedHeaderNames;
        const map = new MultiMap();
        map.put(HttpHeaders.HOST, true);
        if ( this.useSnDate ) {
            map.put(HttpHeaders.X_SN_DATE, true);
        } else {
            map.put(HttpHeaders.DATE, true);
        }
        if ( httpHeaders.containsKey(HttpHeaders.CONTENT_MD5) ) {
            map.put(HttpHeaders.CONTENT_MD5, true);
        }
        if ( httpHeaders.containsKey(HttpHeaders.CONTENT_TYPE) ) {
            map.put(HttpHeaders.CONTENT_TYPE, true);
        }
        if ( httpHeaders.containsKey(HttpHeaders.DIGEST) ) {
            map.put(HttpHeaders.DIGEST, true);
        }
        if ( signedHeaderNames && signedHeaderNames.length > 0 ) {
            signedHeaderNames.forEach(e => map.put(e, true));
        }
        return lowercaseSortedArray(map.keySet());
    }
canonicalHeaderNames ( ) { const httpHeaders = this . httpHeaders ; const signedHeaderNames = this . signedHeaderNames ; const map = new MultiMap ( ) ; map . put ( HttpHeaders . HOST , true ) ; if ( this . useSnDate ) { map . put ( HttpHeaders . X_SN_DATE , true ) ; } else { map . put ( HttpHeaders . DATE , true ) ; } if ( httpHeaders . containsKey ( HttpHeaders . CONTENT_MD5 ) ) { map . put ( HttpHeaders . CONTENT_MD5 , true ) ; } if ( httpHeaders . containsKey ( HttpHeaders . CONTENT_TYPE ) ) { map . put ( HttpHeaders . CONTENT_TYPE , true ) ; } if ( httpHeaders . containsKey ( HttpHeaders . DIGEST ) ) { map . put ( HttpHeaders . DIGEST , true ) ; } if ( signedHeaderNames && signedHeaderNames . length > 0 ) { signedHeaderNames . forEach ( e => map . put ( e , true ) ) ; } return lowercaseSortedArray ( map . keySet ( ) ) ; }
Compute the canonical HTTP header names to include in the signature.
Compute the canonical HTTP header names to include in the signature .
// use a MultiMap to take advantage of case-insensitive keys