Allow nil HTTP user agent

For #5182