You are here: Foswiki>Tasks Web>Item14249 (18 Feb 2017, GeorgeClark)Edit Attach

Item14249: Foswiki::Net uses userinfo functions not available in older versions of LWP.

pencil
Priority: Normal
Current State: Closed
Released In: 2.1.3
Target Release: patch
Applies To: Engine
Component: FoswikiNet
Branches: master Release02x01
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
Fix taken from Item14198:

Then PublishPlugin bails out on some topics with the following error:

***  ERROR: Main.AdminGroup not published: Can't locate object method "userinfo" via package "URI::_generic" at /usr/share/perl5/URI/WithBase.pm line 52.

This is related to Item13444, I believe, and probably fixed by the following:

diff --git a/lib/Foswiki/Net.pm b/lib/Foswiki/Net.pm
index d7c426f..2c0b9d3 100644
--- a/lib/Foswiki/Net.pm
+++ b/lib/Foswiki/Net.pm
@@ -212,7 +212,7 @@ sub getExternalResource {
             $uri->scheme( $puri->scheme() );
             $uri->host( $puri->host() );
             $uri->port( $puri->port() );
-            if ( $puri->userinfo() ) {
+            if ( $puri->can("userinfo") && defined $puri->userinfo() ) {
                 require MIME::Base64;
                 my $base64 =
                   MIME::Base64::encode_base64( $puri->userinfo(), '' );
@@ -220,7 +220,7 @@ sub getExternalResource {
             }
         }
 
-        if ( $uri->userinfo() ) {
+        if ( $uri->can("userinfo") && defined $uri->userinfo() ) {
             require MIME::Base64;
             my $base64 = MIME::Base64::encode_base64( $uri->userinfo(), '' );
             $req .= "Authorization: Basic $base64\r\n";
@@ -308,7 +308,7 @@ sub _GETUsingLWP {
     my $user;
     my $pass;
     ( $user, $pass ) = split( ':', $uri->userinfo(), 2 )
-      if ( $uri->userinfo() );
+      if ( $uri->can("userinfo") && defined $uri->userinfo() );
     my $ua = new Foswiki::Net::UserCredAgent( $user, $pass );
     $ua->proxy( [ 'http', 'https' ], $puri->as_string() ) if $puri;
     my $response = $ua->request($request);

-- FlorianSchlichting - 11 Oct 2016

-- GeorgeClark - 07 Dec 2016

 

ItemTemplate edit

Summary Foswiki::Net uses userinfo functions not available in older versions of LWP.
ReportedBy GeorgeClark
Codebase 2.1.2
SVN Range
AppliesTo Engine
Component FoswikiNet
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:219f7966d857
TargetRelease patch
ReleasedIn 2.1.3
CheckinsOnBranches master Release02x01
trunkCheckins
masterCheckins distro:219f7966d857
ItemBranchCheckins
Release02x01Checkins distro:219f7966d857
Release02x00Checkins
Release01x01Checkins
Topic revision: r2 - 18 Feb 2017, GeorgeClark - This page was cached on 23 Sep 2017 - 16:38.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License