[Yanel-dev] empty files
simon litwan
simon.litwan at wyona.com
Tue Jul 8 13:23:48 CEST 2008
Julian Reschke schrieb:
> simon litwan wrote:
>> i tried it on apache and it just serves the empty document. the
>> header looks like this:
>> HTTP/1.x 304 Not Modified
>> Date: Tue, 08 Jul 2008 09:26:17 GMT
>> Server: Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2 mod_ssl/2.2.3
>> OpenSSL/0.9.8c
>> Connection: Keep-Alive
>> Keep-Alive: timeout=15, max=100
>> Etag: "308004-0-9b1e6700"
>>
>> in tamper-data i also see the size (-1). but i'm not sure if tamper
>> figures it out by its self, because i can't see anything in the header.
>>
>> but i really consider the behavior of yanel a bug.
>>
>> cheers
>> simon
>
> This is a response to a conditional request ("If-None-Match" or
> "If-Unmodified-Since").
thanks for your response
now i see the problem. i just made a reload when i had a look at the
header, my fault.
when i look at the header for the first request i get:
HTTP/1.x 200 OK
Date: Tue, 08 Jul 2008 10:14:48 GMT
Server: Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2 mod_ssl/2.2.3 OpenSSL/0.9.8c
Last-Modified: Tue, 08 Jul 2008 10:14:33 GMT
Etag: "308004-0-7554d440"
Accept-Ranges: bytes
Content-Length: 0
Expires: Tue, 08 Jul 2008 10:14:49 GMT
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html
>
> If the question was: "how do I serve a file with length 1" (as opposed
> to a non-empty file), the answer is: the same way as any non-empty
> file. Just state "Content-Length: 0".
i think we could say this is the original question and your answer is
what i expected.
so i think we should change the behavior of yanel.
does somebody knows what was the intention for the following code in
YanelServlet:
if (bytesRead == -1) {
String message = "InputStream of view does not seem
to contain any data!";
Element exceptionElement = (Element)
doc.getDocumentElement().appendChild(doc.createElementNS(NAMESPACE,
"exception"));
exceptionElement.appendChild(doc.createTextNode(message));
response.setStatus(javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
setYanelOutput(request, response, doc);
return response;
}
cheers
simon
>
> BR, Julian
> _______________________________________________
> Yanel-development mailing list
> Yanel-development at wyona.com
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
More information about the Yanel-development
mailing list