[1.7.x] Removed reference to old middleware

Backport of 0b5bafe993 from master