Skip to content

fix: add favicon resource resolver #4931

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

danielkelemen
Copy link
Member

related to #4930

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

public static class FaviconResourceResolver extends PathResourceResolver {
@Override
protected Resource getResource(String resourcePath, @NonNull Resource location) throws IOException {
final var idx = resourcePath.lastIndexOf(47);
Copy link
Preview

Copilot AI Feb 26, 2025

Choose a reason for hiding this comment

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

If resourcePath does not contain '/', lastIndexOf returns -1, which will cause substring to throw an exception; add a check for idx < 0 before calling substring.

Suggested change
final var idx = resourcePath.lastIndexOf(47);
final var idx = resourcePath.lastIndexOf(47);
if (idx < 0) {
return null; // or handle appropriately
}

Copilot uses AI. Check for mistakes.

@danielkelemen danielkelemen deleted the 4930-resource-resolver branch April 10, 2025 06:10
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.

1 participant