Skip to content

Commit

Permalink
fix: corretly bind request/resource passed to pouchdb-express
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Jul 9, 2016
1 parent a06328b commit f14df63
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Expand Up @@ -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%]/

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit f14df63

Please sign in to comment.