Skip to content

Read request body by event callback #109

Closed
@xfeep

Description

@xfeep

The original requirement is from here.

Current Situation

nginx-clojure will read request body in non-blocking way before invoking content handler so that a content handler can get the body stream easily, e.g.

  • Java
InputStream body = request.get(MiniConstants.BODY);
  • Clojure
(:body request)

If request body buffer size is smaller than the request body size temp file will be used. Request body buffer size can be controlled by nginx directive client_body_buffer_size and it is two pages size ,e.g. 8k by default .

Changes for This New Feature

UPDATED v2

  1. We'll extend the existing directive always_read_body whose default value is before_content_handler
  2. When always_read_body is off nginx-clojure won't try to read request body, content handler can add a channel listener to accept downstream read events.
  3. When always_read_body is on it is equivalent to before_rewrite_handler

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions