I wasted half hour on this, might save same time for someone else
I am using joi validation for headers and this plugin for translations. When headers are passed through joi validations, it converts the headers key to all lower cases... So Accept-Language becomes accept-language...
Now in this plugin's config, I set languageHeaderField to Accept-Language... Looks like this plugin matches the header key case sensitively... Changing the value to accept-language made it working...
I wasted half hour on this, might save same time for someone else
I am using joi validation for headers and this plugin for translations. When headers are passed through joi validations, it converts the headers
key
to all lower cases... SoAccept-Language
becomesaccept-language
...Now in this plugin's config, I set
languageHeaderField
toAccept-Language
... Looks like this plugin matches the header key case sensitively... Changing the value toaccept-language
made it working...I Google a bit and found this link: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 It says headers are case insensitive, thats why probably joi converts them to lowercase. It would be good if this plugin does the same...