private static MidFunc GetStream(StreamResource streams) => async(context, next) =>
        {
            var options = new ReadStreamOperation(context.Request);

            var response = await streams.Get(options, context.RequestAborted);

            await context.WriteResponse(response);
        };
        private static MidFunc GetStream(StreamResource streams) => next => async env =>
        {
            var context = new OwinContext(env);

            var options = new ReadStreamOperation(context.Request);

            var response = await streams.GetPage(options, context.Request.CallCancelled);

            using (new OptionalHeadRequestWrapper(context))
            {
                await context.WriteHalResponse(response);
            }
        };