Skip Menu |

This queue is for tickets about the Dist-Zilla-Plugin-UploadToStratopan CPAN distribution.

Report information
The Basics
Id: 118041
Status: rejected
Priority: 0/
Queue: Dist-Zilla-Plugin-UploadToStratopan

People
Owner: Nobody in particular
Requestors: TEAM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.012
Fixed in: (no value)



Subject: Upload failures with Mojolicious 7.0+
Hi, This might be caused by Mojolicious API changes, but the current version of UploadToStratopan fails the login step. Attached patch works for me. cheers, Tom
Subject: 2016-09-22-stratopan-mojo-fixes.patch
diff --git a/lib/Dist/Zilla/Plugin/UploadToStratopan.pm b/lib/Dist/Zilla/Plugin/UploadToStratopan.pm index f4081ca..54d4894 100644 --- a/lib/Dist/Zilla/Plugin/UploadToStratopan.pm +++ b/lib/Dist/Zilla/Plugin/UploadToStratopan.pm @@ -67,14 +67,15 @@ sub release { $tarball = "$tarball"; # stringify object my $ua = $self->_ua; + $ua->max_redirects(3); my $tx = $ua->post( $self->_strato_base . '/signin', form => { login => $self->_username, password => $self->_password } ); - if ( my $error = $tx->res->dom->find( 'div#page-alert p' ) ) { - $self->log_fatal( $error->all_text ); + if ( my $error = $tx->res->dom->find( 'div#page-alert p' )->first ) { + $self->log_fatal( $error->map('text')->join(" ") ); } my $submit_url = sprintf '%s/%s/%s/%s/stack/add', @@ -89,11 +90,11 @@ sub release { } ); - if ( $tx->res->code == 302 ) { + if ( $tx->res->code == 302 or $tx->res->code =~ /^2/ ) { return $self->log( "success." ); } - $self->log_fatal( $tx->res->dom->find( 'div#page-alert p' )->all_text ); + $self->log_fatal( $tx->res->dom->find( 'div#page-alert p' )->map('text')->join(" ") ); }
Sorry for the long wait, but I just pushed out a new release, could you verify the bug still exists?
I'm closing this issue. Feel free to re-open if needed.