Added a test to verify headers set by default middleware; refs #23939.