Browse files

Limit methods to GET/HEAD/DELETE/POST/PUT, add TODOs

  • Loading branch information...
1 parent 8f2a9c6 commit 8b524710230c82f1b5e1690d265b0d3d9f6546a6 @stash committed May 6, 2010
Showing with 24 additions and 4 deletions.
  1. +10 −0 Feersum.xs
  2. +14 −4 TODO
View
10 Feersum.xs
@@ -576,6 +576,11 @@ process_request_headers (struct feer_client *c, int body_offset)
// MUST have a body
body_is_required = 1;
}
+ else {
+ err = "Feersum doesn't support that method yet\n";
+ err_code = 405;
+ goto got_bad_request;
+ }
// a body potentially follows the headers. Let feer_req retain its
// pointers into rbuf and make a new scalar for more body data.
@@ -620,6 +625,11 @@ process_request_headers (struct feer_client *c, int body_offset)
err_code = 411;
err = "Content-Length required\n";
}
+ else {
+ // XXX TODO support requests that don't require a body
+ err_code = 418;
+ err = "Feersum doesn't know how to handle optional-body requests yet\n";
+ }
got_bad_request:
respond_with_server_error(c, err, 0, err_code);
View
18 TODO
@@ -1,4 +1,14 @@
-* psgi.input streaming
-* allow streaming responses to be HTTP/1.0 "Connection: close" rather than
- HTTP/1.1 "Transfer-Encoding: chunked".
-** maybe match up the streaming flavour with the request version?
+psgi.input streaming
+
+ * add a "read_cb()" method to the psgi.input handle as an extension? EV
+ gets to schedule the watcher in that case rather than bleeding the fd to
+ the handler.
+
+allow streaming responses to be HTTP/1.0 "Connection: close" rather than
+HTTP/1.1 "Transfer-Encoding: chunked".
+
+ * maybe match up the streaming flavour with the request version?
+
+Handle requests that don't require a body.
+
+Better EV-callback error handling.

0 comments on commit 8b52471

Please sign in to comment.