drachtio / drachtio-srf

drachtio signaling resource framework
https://drachtio.org
MIT License
171 stars 60 forks source link

Make header read case insensitive, and keep case when proxying headers #165

Closed danvirsen closed 7 months ago

danvirsen commented 1 year ago

I ran into a problem when testing two clients that use custom headers. The headers were only passed on from client A to client B, but not from client B to client A, even though the headers were defined in proxyRequestHeaders and proxyResponseHeaders. The issue is that client A defines the header in all lower case, and client B use mixed case. proxyRequestHeaders and proxyResponseHeaders need an exact match, including case so I would have to define all variants of casing (or at least the ones that are likely to occur) in order to proxy the headers. This also made checking for these headers quite messy since we needed to disregard the casing manually.

To me it makes sense to leave case as-is when proxying requests, but we should be able to find headers via "has" and "get" without having to match the case.

I'm not a big fan of exposing the "getHeaderName" method in SipMessage, but I haven't come up with a nicer way to handle this.

danvirsen commented 7 months ago

@davehorton Any thoughts on this? Sorry for the direct mention, but it has been a while.

davehorton commented 7 months ago

published in v4.5.33