Added support for MAX_CONTENT_LENGTH option.

* This is known not to work correctly with nginx. However, this commit
  does everything that is possible on the application's side.