Test script:
function main(splash)
local url = 'http://httpbin.org/headers?nocache=' .. math.random()
splash:set_user_agent('FooBar/1.0')
assert(splash:go(url, 'http://httpbin.org'))
assert(splash:wait(0.5))
return {
html = splash:html(),
png = splash:png(),
har = splash:har(),
}
end
Uses Mozilla/5.0 instead of FooBar/1.0.
Specifying the user agent as a header works.