gorilla/handlers — pull request #20 by encryptio (2014-08-20 01:00:43+00:00)
Title: logger: use original URL even if the handler changes it

In the case of http.StripPrefix and similar handlers which modify req.URL during ServeHTTP calls, the req.URL in the request after it has been serviced is not neccessarily the URL that was originally requested.

It's significantly more useful to log the original URL, especially because a codebase that depends on this typically uses it extensively, and the final URLs will be useless.

This patch adds a url.URL argument to writeLog and keeps a copy of the original request URL before calling the interior ServeHTTP.