Modified middleware to allow tweaks to requestUrl