Check that staticdir has been set before checking Accept headers

As @dthom91 pointed out, this handler is called per-request so the fewer
operations we can do here the better.