[libnet-openid-common-perl] 02/04: make URIFetch->fetch return decoded_content (closes #78218)
gregor herrmann
gregoa at debian.org
Sun Feb 7 21:50:37 UTC 2016
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to annotated tag v1.15
in repository libnet-openid-common-perl.
commit 6a4079e95ad25f248587e4dda09d93de1173016c
Author: Roger Crew <crew at cs.stanford.edu>
Date: Mon Apr 1 03:35:30 2013 -0700
make URIFetch->fetch return decoded_content (closes #78218)
backs out portion of 3b77529 where we try to do the decoding ourselves (bleah)
---
lib/Net/OpenID/URIFetch.pm | 6 +-----
lib/Net/OpenID/Yadis.pm | 14 --------------
2 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/lib/Net/OpenID/URIFetch.pm b/lib/Net/OpenID/URIFetch.pm
index 909c30a..41d7110 100644
--- a/lib/Net/OpenID/URIFetch.pm
+++ b/lib/Net/OpenID/URIFetch.pm
@@ -112,14 +112,10 @@ sub fetch {
return $cached_response->();
}
else {
- my $content = $res->content;
+ my $content = $res->decoded_content;
my $final_uri = $res->request->uri->as_string();
my $final_cache_key = "URIFetch:${prefix}:${final_uri}";
- if ($res->content_encoding && $res->content_encoding eq 'gzip') {
- $content = Compress::Zlib::memGunzip($content);
- }
-
if ($content_hook) {
$content_hook->(\$content);
}
diff --git a/lib/Net/OpenID/Yadis.pm b/lib/Net/OpenID/Yadis.pm
index a565fba..8a6321d 100644
--- a/lib/Net/OpenID/Yadis.pm
+++ b/lib/Net/OpenID/Yadis.pm
@@ -179,20 +179,6 @@ sub discover {
#survey says Yes!
$self->xrd_url($final_url);
- if ($charset && ($charset ne 'utf-8') && Encode::find_encoding($charset)) {
- # not UTF-8, but it's one of the ones we know about, so...
- Encode::from_to($xrd,$charset,'utf-8');
- # And now we are UTF-8, BUT...
- # XML spec requires specifying the encoding in the prolog
- # whenever it's not UTF-8 *and* death if the specified encoding
- # doesn't match the actual encoding, so we have to fix the prolog
- my $encoding_re = qr/\s+encoding\s*=\s*['"][A-Z][-A-Za-z0-9._]*["']/;
- $xrd =~ s/$encoding_re//
- # but make sure there *is* a prolog, first; also allow for the
- # possibility of BOM (byte-order mark) re-encoding into
- # garbage at the beginning
- if ($xrd =~ m/\A.{0,4}<?xml\s+version\s*=\s*['"][0-9.]+["']$encoding_re/);
- }
return $self->parse_xrd($xrd);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-openid-common-perl.git
More information about the Pkg-perl-cvs-commits
mailing list