Skip Menu |
 

This queue is for tickets about the HTTP-Message CPAN distribution.

Report information
The Basics
Id: 105787
Status: resolved
Priority: 0/
Queue: HTTP-Message

People
Owner: Nobody in particular
Requestors: blue [...] thisisnotmyrealemail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 6.07
Fixed in: 6.08



Subject: warning when using undef as value in post with form_data
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-6324-1436492397-1593.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 471
Download (untitled) / with headers
text/plain 471b
This was not an issue prior to version 6.07. Undef is supposed to be a valid value for content, but it now results in the following warning only when the content_type is set to form-data: Use of uninitialized value $v in concatenation (.) or string at .../HTTP/Request/Common.pm line 142 Example snippet: my $res = $ua->post( 'https://www.google.com/', content_type => "multipart/form-data; boundary=----1234", content => [ a => 1, b => undef ], );
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-6324-1436492397-1593.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: API
References: <rt-4.0.18-6324-1436492397-1593.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-4398-1436493046-1554.0-0-0 [...] rt.cpan.org>
Message-ID: <rt-4.0.18-4398-1436493046-802.105787-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
From: blue [...] thisisnotmyrealemail.com
Content-Length: 688
Download (untitled) / with headers
text/plain 688b
On Thu Jul 09 21:39:57 2015, blue wrote: Show quoted text
> This was not an issue prior to version 6.07. > Undef is supposed to be a valid value for content, but it now results > in the following warning only when the content_type is set to form- > data: > > Use of uninitialized value $v in concatenation (.) or string at > .../HTTP/Request/Common.pm line 142 > > Example snippet: > > my $res = $ua->post( > 'https://www.google.com/', > content_type => "multipart/form-data; boundary=----1234", > content => [ a => 1, b => undef ], > );
This looks like it's because the warnings pragma was enabled in this release. Adding something like $v = '' unless defined $v; should fix it.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-6324-1436492397-1593.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-6324-1436492397-1593.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-8274-1436497609-1023.105787-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 34
Apologies! 6.08 has been uploaded.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.