Re: [rt-users] REST interface and long file names?

2010-11-01 Thread Jesse Vincent
If you guys could file a bug report, that'd be great.

Thanks.



On Fri 29.Oct'10 at 12:44:46 -0700, Tom Lahti wrote:
> Jesse's intent for the REST interface was to be RFC822 compliant, and that 
> ain't.  So I while I could probably make rt-client tolerate it, I probably 
> should push this to Jesse as REST isn't working the way he intended in this 
> case.  It will probably cause issues with other systems that interface with 
> RT's REST API as well.
> 
> --
> Tom Lahti, SCMDBA, LPIC-1, CLA
> BIT LLC
> 425-251-0833 x 117
> 
> 
> 
> 
> On Oct 28, 2010, at 3:47 PM, Thierry Thelliez wrote:
> 
> > I found a strange answer from RT while calling the REST interface.
> > You can see below that extra lines are added before and after the
> > Subject line.  This does not work well with rt-client (ruby library)
> > while parsing the answer. There should not be these extra lines.
> > 
> > Is that because we have a long filename? Or a comma in the title?
> > 
> > 
> > 
> > '
> > RT/3.8.7 200 Ok
> > 
> > id: 1302
> > 
> > Subject: _xx__xx_xxx_x_ xxx 
> >   xx xxx xx xx., xxx..xls
> > 
> > Creator: 574
> > Created: 2010-06-08 02:09:24
> > Transaction: 1970
> > Parent: 1300
> > '
> > 
> > 
> > Thanks,
> > Thierry
> 


Re: [rt-users] REST interface and long file names?

2010-10-29 Thread Thierry Thelliez
Agreed.

My fix is just temporary for someone else that could encounter the
same issue now.  The real fix should be on the RT side.

I am not familiar enough with the RT stack to find where the issue is.
When I print the attachment subject from Perl, it does wrap on two
lines.  Maybe the issue is even earlier in the process? Data entry?

Thierry


Re: [rt-users] REST interface and long file names?

2010-10-29 Thread Tom Lahti
Jesse's intent for the REST interface was to be RFC822 compliant, and that 
ain't.  So I while I could probably make rt-client tolerate it, I probably 
should push this to Jesse as REST isn't working the way he intended in this 
case.  It will probably cause issues with other systems that interface with 
RT's REST API as well.

--
Tom Lahti, SCMDBA, LPIC-1, CLA
BIT LLC
425-251-0833 x 117




On Oct 28, 2010, at 3:47 PM, Thierry Thelliez wrote:

> I found a strange answer from RT while calling the REST interface.
> You can see below that extra lines are added before and after the
> Subject line.  This does not work well with rt-client (ruby library)
> while parsing the answer. There should not be these extra lines.
> 
> Is that because we have a long filename? Or a comma in the title?
> 
> 
> 
> '
> RT/3.8.7 200 Ok
> 
> id: 1302
> 
> Subject: _xx__xx_xxx_x_ xxx 
>   xx xxx xx xx., xxx..xls
> 
> Creator: 574
> Created: 2010-06-08 02:09:24
> Transaction: 1970
> Parent: 1300
> '
> 
> 
> Thanks,
> Thierry



Re: [rt-users] REST interface and long file names?

2010-10-29 Thread Thierry Thelliez
I fixed the issue on the client side (rt-client in ruby).  It should
be fixed on the server side but I am not intimate enough for the RT
code to propose a fix.

In rt-client / client.rb / get_attachment, I replaced

headers = TMail::Mail.parse(resp)

with

resp.gsub!(/(id:\s.*\n)\n/,'\1') #Extra line after id:
resp.gsub!(/\n(\nCreator:\s)/,'\1')  #Extra line before Creator:
resp.gsub!(/(Subject:\s.*)\n\s+(.*\n)/,'\1 \2')  #Subject wrapping
headers = TMail::Mail.parse(resp)



Thierry


Re: [rt-users] REST interface and long file names?

2010-10-28 Thread Thierry Thelliez
Here are few more details.

The web interface access to this attachment works fine.  Looking at
the full header under Ticket/Display.html?ShowHeaders=1;id=123  shows
the subject in one line. And I can download the attachment fine.

But if I call REST/1.0/ticket/123/attachments/1302  then the
mysterious two extra lines and the wrapping appear.



Thierry


Re: [rt-users] REST interface and long file names?

2010-10-28 Thread Thierry Thelliez
Another piece of info, the filename is 111 character long.


Thierry