[fpc-pascal] Re: fpweb: handling DELETE method as well as GET
Michael Van Canneyt
michael at freepascal.org
Thu Feb 28 12:22:33 CET 2013
On Thu, 28 Feb 2013, Reinier Olislagers wrote:
> On 28-2-2013 10:58, Reinier Olislagers wrote:
>> Using fpweb, I'm trying to handle DELETE requests.
>> The code below works for GET calls:
>> GET /cgi-bin/tigercgi/document/ HTTP/1.1" 200
>> but gives a 500 server error for DELETE calls:
>> DELETE /cgi-bin/tigercgi/document/ HTTP/1.1" 500
>> The code doesn't even seem to hit the function:
>> AResponse.Contents.Add('<p>Got request method: '+ARequest.Method+'</p>');
>> doesn't seem to be hit.
>> How should I fix this?
> Oh, the Apache error log shows this for for the delete requests:
> Premature end of script headers: tigercgi
Fixed in rev. 23667.
In fact, I've disabled the method checking altogether.
At a later point, we can consider having a property that
checks the method and enforces a HTTP spec compliant method.
More information about the fpc-pascal