http-useragent
http-useragent copied to clipboard
HTTP::UserAgent.new(timeout => 10) does not set the timeout but probably should
I was expecting this code to work:
my $ua = HTTP::UserAgent.new(timeout => 10);
say $ua # HTTP::UserAgent.new(timeout => 180, …)
But it doesn't, and it seems like I have to set the timeout with $ua.timeout = 10
. Would've been great if it was possible to set the timeout right from the constructor.
https://github.com/sergot/http-useragent/blob/06a70d5cc8905dd5c5e16f26c8ca8cc1ad85f369/lib/HTTP/UserAgent.pm6#L75
s/submethod BUILD/submethod TWEAK/