Update middleware default function in docs.
Add an `open` option