Declare `CaseInsensitiveMap` as an interface that extends `SortedMap` and use this for the type of headers. Please see below.