From 0e8c281886b02ea93304c1e359422a6904b71676 Mon Sep 17 00:00:00 2001 From: Philipp Naderer Date: Wed, 5 Oct 2016 11:31:27 +0200 Subject: [PATCH] Allows middlewares to preserve & modify input stream (#351) --- modules/ringo/jsgi/connector.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ringo/jsgi/connector.js b/modules/ringo/jsgi/connector.js index 77f520c1a..bfbbcb584 100644 --- a/modules/ringo/jsgi/connector.js +++ b/modules/ringo/jsgi/connector.js @@ -68,6 +68,12 @@ function initRequest(request) { input = new Stream(request.env.servletRequest.getInputStream()); return input; }, + set: function(stream) { + if (!stream instanceof Stream) { + throw new Error("Input must be a Stream!"); + } + input = stream; + }, enumerable: true }); Object.defineProperty(request.jsgi, "errors", {