The 404 handler that previously existed didn't actually handle the
file not found case, because we hit it too late in the generator,
so all control was over in Apache. In order to deal with this
instead try to open and close the file early, to trigger the
exception before we get to the generator. This opens us up to a
small race, which we should never see on a real system. And also
let's us keep the generator approach which we need from a memory
perspective on the server.
Also ensure that we are only handling the non-query string part
of path info when we are trying to find a file, otherwise query
strings make everything 404.
And lastly, give us an out if we want to make a web browser get
the text version instead of the html version via passing
?content-type=text/plain on the query string. Some logs like
nova-api are so large (35MB of html) that some browsers on some
OSes completely fall over dealing with them. This will let those
users get around it if it's a problem.
Change-Id: I7383deb95dcbc097aa6c1053dc9bb5a8de04cf26