Skip to content

fix: resolve ServletContext resources from META-INF/resources - #1738

Merged
reedham-aws merged 2 commits into
aws:mainfrom
reedham-aws:servlet-resources
Dec 4, 2026
Merged

reedham-aws merged 2 commits into
aws:mainfrom
reedham-aws:servlet-resources

Conversation

@reedham-aws

Copy link
Copy Markdown
Contributor

Align getResource, getResourceAsStream and getRealPath with the Servlet spec web resource lookup.

Issue #, if available:

Description of changes:

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

Align getResource, getResourceAsStream and getRealPath with the Servlet
spec web resource lookup.
ckawl

This comment was marked as duplicate.

return null;
}
}
return WEB_ROOT + path;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Everything looks good to me.
Just one optional thing, for '/' or any path that points to the folder this resolvees to the "META-INF/resources" dir itself.
Do we want to return null for the said case or is the returning intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think that should be expected behavior, either way not worried about it. Good point about the edge case, though.

@reedham-aws
reedham-aws merged commit 8387558 into aws:main Dec 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants