added bool flag to use req.url instead of the fully qualified path

Tried my hand at it, hope i got everything.