Update middleware.py

Remove deprecated defaults