CGRU / cgru

CGRU - AFANASY
http://cgru.info/
GNU Lesser General Public License v3.0
278 stars 111 forks source link

Afserver behind https proxy #556

Closed sebastianelsner closed 1 year ago

sebastianelsner commented 1 year ago

Hi, I tried to run the afserver behind a proxy, so I can get SSL connection and basic http auth. Afserver expects the http header to include a "AFANASY" value. The proxies I tried re-write headers to "Afanasy" or "afanasy". This does not seem to be configurable in the proxies. They either say "Capital letter is the de-facto standard" or they say "RFC 2616, Paragraph 4.2 states that http headers are case-insensitive".

I think this affects: https://github.com/CGRU/cgru/blob/66b6f3ebdcc8223199f10f48745ca3f51a487b27/afanasy/src/libafanasy/name_afnet.cpp#L109 The strncmp should be case-IN-sensitive.

I might fix this if it come up that I actually need this in production.

timurhai commented 1 year ago

Hi! Ok, you cat try to use strncasecmp. Or what is the question?

sebastianelsner commented 1 year ago

Yes! That is the question :D I will try to get around to test and then make a PR

sebastianelsner commented 1 year ago

Just to give an update. This actually worked in a initial test!