Backport #11437 to 4-0-stable. Fix default rendered format when calling render method without :content_type option.
Merge pull request #11438 from kennyj/fix_11393-40

Backport #11437 to 4-0-stable. Fix default rendered format when calling render method without :content_type option.
re-introduce `select_for_count` private method.

See https://github.com/rails/rails/commit/da9b5d4a8435b744fcf278fffd6d7f1e36d4a4f2#commitcomment-3630064 for discussion.
Revert "Don't use Rack::Sendfile middleware if x_sendfile_header is not present"

This reverts commit 19ac034bdc9be175eff7cf54208ba14b43d97681.
And allows webservers to configure X-Sendfile-Type.

Closes #11440 thanks to [@MSch]
Rack::Sendfile is now included in middleware by default, change tests to reflect that
Merge pull request #11069 from ykzts/actiondispatch-ssl-secure-flag-igonore-case

Flag cookies as secure with ignore case in ActionDispatch::SSL
Merge pull request #11065 from gbuesing/hstsfix

ActionDispatch:SSL: don't include STS header in non-https responses