I'm having an issue when using ansible-openwisp2 behind a HAProxy reverse proxy. HAProxy makes all headers lowercase per HTTP/2 from what i can read in https://http2.github.io/http2-spec/#rfc.section.8.1.2
The openwisp-config agent is case sensitive when checking the header. Adding an i in the grep check will make it case insensitive.
Like so:
local is_controller=$(grep -ic "X-Openwisp-Controller: true" $1)
Tested with OpenWrt 18.06.5 r7897-9d401013fc on a MediaTek MT7620A and OpenWrt 19.07.2 r10947-65030d81f3 in a virtual machine. It worked for me, but i have not really made any larger compatibility tests.
Good day,
I'm having an issue when using ansible-openwisp2 behind a HAProxy reverse proxy. HAProxy makes all headers lowercase per HTTP/2 from what i can read in https://http2.github.io/http2-spec/#rfc.section.8.1.2 The openwisp-config agent is case sensitive when checking the header. Adding an
i
in the grep check will make it case insensitive.Like so:
local is_controller=$(grep -ic "X-Openwisp-Controller: true" $1)
instead of the current check https://github.com/openwisp/openwisp-config/blob/fc04e62eace3f7d43b07bb19bbf6edb8b2b7ba1b/openwisp-config/files/openwisp.agent#L121
Tested with
OpenWrt 18.06.5 r7897-9d401013fc
on a MediaTek MT7620A andOpenWrt 19.07.2 r10947-65030d81f3
in a virtual machine. It worked for me, but i have not really made any larger compatibility tests.