Subject: | RT::Client::REST 0.44 broken for uploading attachment |
Date: | Mon, 23 Sep 2013 23:55:29 +0000 |
To: | "bug-RT-Client-REST [...] rt.cpan.org" <bug-RT-Client-REST [...] rt.cpan.org> |
From: | Ben Kolera <bkolera [...] iseek.com.au> |
I'm having an issue where attachments aren't working in version 0.44. I'm
just getting an error (from RT) that says "No attachment for run.sh".
This brand new line from 0.44:
https://metacpan.org/source/DAMS/RT-Client-REST-0.44/lib/RT/Client/REST.pm#
L521
Seems to be stringifying the array used to give the arrayref/attachment to
HTTP::Common::Request's POST method.
As seen here:
--------
[bkolera@bkolera6.devvm:~]$socat
<mailto:bkolera@bkolera6.devvm.iseek.com.au>devvm:~]$socat> STDIO
TCP-LISTEN:2000,reuseaddr
POST //REST/1.0/ticket/1006360/comment HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: bkolera6.devvm:2000
User-Agent: RT::Client::REST/0.44
Content-Length: 239
Content-Type: multipart/form-data; boundary=xYzZY
--xYzZY
Content-Disposition: form-data; name="attachment_1"
Attachment=ARRAY(0xa12faf0)
--xYzZY
Content-Disposition: form-data; name="content"
Ticket: 1006360
Action: comment
Text: Attachment test.
Attachment: run.sh
--xYzZY--
--------
0.43 Which doesn't have that line and does not exhibit the problem.
Is the fix as simple as skipping attachments in that map and letting
HTTP::Common::Request take take of the encoding? If so, I can create a
patch if you'd like.
Kind Regards,
Ben Kolera