canonicalHeaders passes all test.
Refactored canonicalHeaders