Slightly more robust parsing of url in middleware.
Update middleware and README.