Fix GH-37036

Comment From: quaff

Superseded by https://github.com/spring-projects/spring-boot/pull/37044

Comment From: snicoll

Thanks @quaff