- changed status to resolved
'User-Agent' header can not be set via 'http headers' array
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)
-
repo owner -
repo owner Fixed: Issue
#241: Add the User-Agent header in the http protocol test only if it is not part of custom headers list.→ <<cset 862609aa37b7>>
-
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>>
-
repo owner - removed version
Removing version: 5.14 (automated comment)
- Log in to comment
fix Issue
#241: Add the User-agent header only if it is not in the custom headers list→ <<cset b37f585fb76b>>