renamed middleware to applyCSRF, re: #2082