curveball / core

The Curveball framework is a TypeScript framework for node.js with support for modern HTTP features.
https://curveballjs.org/
MIT License
525 stars 7 forks source link

HeadersInterface needs a getMany() function #145

Closed evert closed 3 years ago

evert commented 4 years ago

The HeadersInterface has a get() function that returns the value of a header, or null.

Headers with the same name can appear multiple times. If this happens, this function will concatenate headers with ,. This is perfectly legal as in HTTP it's always possible to merge multiple headers with the same name as one.

However, sometimes its useful to get every 'instance' of a header, and not have curveball concatenate them.

We should add a getMany(headerName: string): string[] that returns 0 or more headers.