kazu-yamamoto / logger

A fast logging system for Haskell
159 stars 68 forks source link

Support custom HTTP header for IP address source #215

Closed cevantes closed 3 months ago

cevantes commented 3 months ago

The case here is we use a proxy which replaces X-Real-IP with something not real and instead provides client's IP address via a custom header.

kazu-yamamoto commented 3 months ago

@cevantes Gentle ping.

cevantes commented 3 months ago

This works in our app now, but I am thinking maybe the new constructor should take an ordered list of custom headers, so that if one is missing it falls back to the next one, what do you think? Also my problem could be mitigated by altering nginx settings or Middleware but that's out of scope for this PR, just saying for posterity.

kazu-yamamoto commented 3 months ago

Sorry for the delay. I was on vacation. Would you show me the code for the new constructor?

cevantes commented 3 months ago

Sure, here we go

kazu-yamamoto commented 3 months ago

The code is OK. But I don't think this is a breaking change. So, I would still suggest v2.4.1

cevantes commented 3 months ago

Sure, updated

kazu-yamamoto commented 3 months ago

Merged. The new version has been released. Thanks!

kazu-yamamoto commented 2 weeks ago

I'm going to review and merge #218 and release v2.5.