From f14df63cff03d392d0990bf7190e5fc39a0126f2 Mon Sep 17 00:00:00 2001 From: Gregor Date: Sat, 9 Jul 2016 13:28:18 -0400 Subject: [PATCH] fix: corretly bind request/resource passed to pouchdb-express closes https://github.com/hoodiehq/hoodie/issues/526 --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0515bb2..ac08917 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ hapiCouchDbStore.attributes = { var url = require('url') var boom = require('boom') +var hapiToExpress = require('hapi-to-express') var validDbName = /^[a-zA-Z%]/ @@ -68,8 +69,11 @@ function hapiCouchDbStore (server, options, next) { } }) } - request.raw.req.url = newUrl - xapp(request.raw.req, request.raw.res) + + var hapress = hapiToExpress(request, reply) + hapress.req.url = newUrl + + xapp(hapress.req, hapress.res) } next()