Fix AttributeError on Http404.
Merge pull request #910 from oremj/varyfix

Fix AttributeError on Http404.