Issue #241 resolved

'User-Agent' header can not be set via 'http headers' array

upbeatrobot
created an issue

I have a setup that requires testing with specific user agents, so the default 'Monit/5.14' is not sufficient. I figured I'd specify it as part of the 'if failed' statement, like so;

with http headers [User-Agent: 'Mozilla/5.0 (compatible; Monit 5.14; +https://example.com)']

But that does not work; it still uses the default UA string, and the target nginx will complain in the error logs, about 'client sent invalid header line: ":Mozilla/5.0 (compatible; Monit 5.14; +https://example.com)" while reading client request headers'.

I suspect that this is currently not implemented, so it breaks. Could this be implemented? Would be greatly appreciated, thanks! :)

Comments (4)

  1. Tildeslash repo owner

    fix Issue #241 : the error in the issue description was not due to User-Agent header duplicate (which was present too), but due to parsing of the header value, which broke into two headers on the column character in the "https://..." string:

    H1:             User-Agent: Mozilla/5.0 (compatible; Monit 5.14; +https
    H2(noname):     :Mozilla/5.0 (compatible; Monit 5.14; +https://example.com)
    

    → <<cset e569c499820f>>

  2. Log in to comment