There seems to be a problem with this module when using the AX openid
extension (and probably sreg as well), and server response contains utf-8
data (e.g. cyrillic characters). An exception is thrown, saying something
like: "Caught exception in MyModule->openid "Can't escape \x{043B}, try
uri_escape_utf8() instead at
/usr/local/share/perl5/Net/OpenID/Consumer.pm line 980"". Changing
uri_escape to uri_escape_utf8 (as the error message sais) actually helps.
Subject: | uri_escape.patch |
diff --git a/lib/Net/OpenID/Consumer.pm b/lib/Net/OpenID/Consumer.pm
index dfefa30..7821092 100644
--- a/lib/Net/OpenID/Consumer.pm
+++ b/lib/Net/OpenID/Consumer.pm
@@ -38,7 +38,7 @@ use HTTP::Request;
use LWP::UserAgent;
use Storable;
use JSON qw(encode_json);
-use URI::Escape qw(uri_escape);
+use URI::Escape qw(uri_escape_utf8);
use HTML::Parser;
sub new {
@@ -973,7 +973,7 @@ sub verified_identity {
my $req = HTTP::Request->new(POST => $server);
$req->header("Content-Type" => "application/x-www-form-urlencoded");
- $req->content(join("&", map { "$_=" . uri_escape($post{$_}) } keys %post));
+ $req->content(join("&", map { "$_=" . uri_escape_utf8($post{$_}) } keys %post));
my $ua = $self->ua;
my $res = $ua->request($req);