diff options
author | Simon McVittie <smcv@debian.org> | 2019-02-10 17:22:06 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2019-02-26 22:21:27 +0000 |
commit | d283e4ca1aeb6ca8cc0951c8495f778071076013 (patch) | |
tree | c6e10b583199d2157242b4bc31b22fb2c4ac210d /IkiWiki/Plugin/openid.pm | |
parent | 67543ce1d62161fdef9dca198289d7dd7dceacc0 (diff) | |
download | ikiwiki-d283e4ca1aeb6ca8cc0951c8495f778071076013.tar ikiwiki-d283e4ca1aeb6ca8cc0951c8495f778071076013.tar.gz |
useragent: Automatically choose whether to use LWPx::ParanoidAgent
The simple implementation of this, which I'd prefer to use, would be:
if we can import LWPx::ParanoidAgent, use it; otherwise, use
LWP::UserAgent.
However, aggregate has historically worked with proxies, and
LWPx::ParanoidAgent quite reasonably refuses to work with proxies
(because it can't know whether those proxies are going to do the same
filtering that LWPx::ParanoidAgent would).
Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 'IkiWiki/Plugin/openid.pm')
-rw-r--r-- | IkiWiki/Plugin/openid.pm | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 35ef52a58..eb21955e9 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -219,14 +219,10 @@ sub getobj ($$) { eval q{use Net::OpenID::Consumer}; error($@) if $@; - my $ua; - eval q{use LWPx::ParanoidAgent}; - if (! $@) { - $ua=LWPx::ParanoidAgent->new(agent => $config{useragent}); - } - else { - $ua=useragent(); - } + # We pass the for_url parameter, even though it's undef, because + # that will make sure we crash if used with an older IkiWiki.pm + # that didn't automatically try to use LWPx::ParanoidAgent. + my $ua=useragent(for_url => undef); # Store the secret in the session. my $secret=$session->param("openid_secret"); |