Implement a redirector for gitweb-style URLs.

Add a filter to the host index chain to redirect in the presence of
gitweb-style query parameters. Only handles gitweb URLs using the query
parameter flavor; see gitweb(1) for details.

The intent of this filter is to provide compatibility for preexisting
links to old gitweb URLs to be migrated to Gitiles; of course Gitiles
itself does not create such URLs. For this reason, use HTTP 301 (Moved
Permanently) for the redirect rather than 302 Found.

Include simple but not exhaustive tests; the code block in question is
far more concise than exhaustive tests would be.

Change-Id: Ief7022b7cd419fc0380992071ad6e4a4428a6169
10 files changed