Fixes bug 850966 - Encode slashes in middleware URLs.