HTTP response middleware