我编写了一个使用Net :: OpenID :: Consumer来使用OpenID进行身份验证的Dancer Web应用程序.它适用于Google和MyOpenID,但不适用于Yahoo.当用户尝试使用他们的Yahoo帐户进行身份验证时,HTML :: Parser警告:
Parsing of undecoded UTF-8 will give garbage when decoding entities
这个警告杀了我的应用程序(理所当然).
我没有看到Net :: OpenID :: Consumer(或Common)与此相关的任何现有错误.
HTTP标头和HTML元标记都为“声明的id”URI指定UTF-8.
为什么不为HTML :: Parser解码响应?我错过了一些明显的东西吗
这是相关的代码:
get '/openid_landing' => sub { my $params = params(); my $csr = Net::OpenID::Consumer->new( ua => LWP::UserAgent->new(),consumer_secret => $secret,params => $params,); my $id = $params->{'openid.claimed_id'}; if (my $setup_url = $csr->user_setup_url) { redirect $setup_url; } elsif ($csr->user_cancel) { redirect uri_for('/'); } elsif (my $vident = $csr->verified_identity) { # verified identity,log in or register user ... } else { die "Error validating identity: " . $csr->err; } };