Fix middleware request resource path

Don't assume req.path starts with /resource/.
Merge pull request #35 from ryanashcraft/fix-middleware-resource-path

Fix middleware request resource path