Hi

On 12/12/11 15:51, Davis Ford wrote:
Hi Sergey, quick follow-up... I did add a RequestHandler filter, but it isn't clear to me 
the proper way to get at the "Content-Length" header. I know I'm posting it, 
b/c I'm using curl -v as a client, which shows prints the full request with the -v 
option.  I thought that all the HTTP headers would be available off the Message map, but 
this doesn't seem to be the case.  Is there a better way to get at the headers?

@Override
   public Response handleRequest(Message m, ClassResourceInfo resourceClass)
   {
      if(m.containsKey("Content-Length")) { // returns false }

try injecting JAX-RS HttpHeaders and use it getMediaType method, though the context injection in custom filters may not work well in 2.2.x Please add LoggingInInterceptor - it will show if Content-Type available or not

Cheers, Sergey


-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]]
Sent: Friday, December 09, 2011 11:23 AM
To: [email protected]
Subject: Re: Best way to put max byte limit on file uploads?


On 09/12/11 14:09, Davis Ford wrote:
Unfortunately, it is an older version: 2.2.12 -- should I expect that behavior 
in the old version?  Any specific advice on the best way to implement this 
given these constraints?

May be a primitive solution could be to check Content-Length if it is 
available, from within custom RequestHandler filter ?




--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to