Skip to content

In a reactive web app, SslBundle can no longer open store file locations without using a 'file:' prefix #44535

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: 3.4.x
Choose a base branch
from

Conversation

nosan
Copy link
Contributor

@nosan nosan commented Mar 5, 2025

See #43953

…tResource

Prior to this update, FilteredReactiveWebContextResource was not
considered when preferFileResolution was set to true.

This commit updates the ApplicationResourceLoader to include support for
FilteredReactiveWebContextResource.

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
@@ -132,8 +132,8 @@ public static ResourceLoader get(ResourceLoader resourceLoader) {
* class loader at the time this call is made.
* @param resourceLoader the delegate resource loader
* @param preferFileResolution if file based resolution is preferred over
* {@code ServletContextResource} or {@link ClassPathResource} when no resource prefix
* is provided.
* {@code ServletContextResource}, {@code FilteredReactiveWebContextResource} or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look to this and, unfortunately, I don't think that we can use that option as I realize now that it's an implementation detail (package private on top of it). This seems a bit fragile that we rely on this, compared to the standard ServletContextResource. I am still digging what our options are.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resource implementation that replaces the {@link org.springframework.web.context.support.ServletContextResource} in a reactive web application.

org.springframework.boot.web.reactive.context.FilteredReactiveWebContextResource is a
part of Spring Boot codebase, so its ServletContextResource but for Reactive.

This seems a bit fragile that we rely on this, compared to the standard ServletContextResource. I am still digging what our options are.

You're right. Unfortunately, it is. With the introduction of ResourceLoader delegation in #42835, followed by the regression fix in #43274, the ApplicationResourceLoader has become a bit complex and fragile overall.

@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Mar 7, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants