Hello Alex,

By making the component handling directly the request, you avoid the connectors to handle the request because the connectors are just in front of the component (even if they are instantiated by the component). Therefore, it seems that you cannot test this kind of limitation without a real HTTP client.

However, I made the same test with the Simple and the AsynchWeb connectors, and the request succeed properly.

Best regards,
Thierry Boileau

Alex Combs a écrit :
I am trying to run a test wherein I create a String that contains 5*1024 bytes
of data, add it to a Request as an http header, feed that request to a Component that is running an http server(like this
http://www.restlet.org/tutorial#part06), and have it fail because the default
size of a header buffer is should only 4*1024 bytes (detailed here
www.restlet.org/docs/ext/com/noelios/restlet/ext/jetty/JettyServerHelper.html

However, I must be adding the String to the Request wrongly, because when I run
my current code it ignores the extra large header and successfully finds the
file. Here is what I am doing currently(using beta 20, if that makes a difference):

...//Setting up a component as detailed at 
http://www.restlet.org/tutorial#part06

Request request = new Request(Method.GET, "http://localhost:8182/testfile";);
Response response = new Response(request);

//This is where I am trying to add the header, which could be wrong
ParameterList parameterList = new ParameterList();
parameterList.add("x-header-name", hugeStringName);
request.getAttributes().put("org.restlet.http.headers",parameterList);
// www.restlet.org/docs/api/org/restlet/data/Message.html#getAttributes()

request.setProtocol(Protocol.HTTP);
response.getServerInfo().setDomain("localhost");
response.getServerInfo().setPort(8182);

component.handle(request,response);

When run, hugeString should be larger than the header buffer, thus causing the
handle to fail, but it doesn't, it finds testfile and returns it.  I know it
should fail because when I do a wget on the command line with the huge header it does fail. So how am I supposed to be adding headers to an Http Request? Thank you

Reply via email to