Attached patch from #6 with an additional test to ensure authentication middleware is used before staticweb.
Attached patch from #6 with an additional test to ensure authentication middleware is used before staticweb.