Graham Dumpleton
grahamd at dscpl.com.au
Tue Oct 19 20:37:04 EDT 2004
On Oct 19 17:17, Johannes Erdfelt <johannes at erdfelt.com> wrote: > > Subject: Re: [patch] vampire 1.1 remove unknown query variables > > Well, it could still be done in Vampire as you propose, but simply have it > > honour the PythonDebug setting. It may be more approriate to return a > > HTTP_BAD_REQUEST if HTTP_INTERNAL_SERVER_ERROR is not appropriate > > in this case. > > I looked at HTTP_BAD_REQUEST, but the HTTP specs seem to imply that it > should only be returned when there is a parsing error during the command > parsing phase. Like if the "GET" or "PUT" command is malformed. Hmmm, where I have: if type(function) != types.FunctionType: return apache.HTTP_BAD_REQUEST in Vampire, I should perhaps then simply return DECLINED or the dreaded HTTP_INTERNAL_SERVER_ERROR. Certainly using HTTP_HAD_REQUEST isn't appropriate. :-( BTW, the RFC says: 10.4.1 400 Bad Request The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. Another document on w3c site says: Bad request 400 The request had bad syntax or was inherently impossible to be satisfied. Yet another site says: 400 Bad Request Impossible request or syntax error And another: 400 Bad Request The request had bad syntax or was inherently impossible to satisfy. The client is discouraged from repeating the request without modifications. Thus, peoples interpretations vary. I would say in this case using it would be reasonable as it satisfies "The client SHOULD NOT repeat the request without modifications". This is in the sense that it ain't going to work the next time if it isn't. -- Graham Dumpleton (grahamd at dscpl.com.au)
|