[1.7.x] Fixed typo in middleware docs.

Function definition should have an ending colon.

Backport of 48241ec9c4 from master