Skip to content
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

CookieFactory META-INF/services cause loading failures #10773

Closed
diamondq opened this issue Apr 28, 2024 · 1 comment · Fixed by #10775
Closed

CookieFactory META-INF/services cause loading failures #10773

diamondq opened this issue Apr 28, 2024 · 1 comment · Fixed by #10775
Assignees
Labels
type: bug Something isn't working

Comments

@diamondq
Copy link

Expected Behavior

The design of the CookieFactory should look for an META-INF/services/io.micronaut.http.cookie.CookieFactory resource (and use it for the class name) and if not found, then it should fall back to HttpCookieFactory.

Actual Behaviour

However, due to the presence of the META-INF/services/io.micronaut.http.cookie.CookieFactory within the micronaut-http library, and this file points to the fallback of HttpCookieFactory, then other overrides are frequently ignored.

So, if the micronaut-http-netty library is present, it has its own META-INF/services/io.micronaut.http.cookie.CookieFactory that points at its own CookieFactory, and it is frequently ignored. Unfortunately, it's even worse, since there's no defined order of ClassLoader.getResources, so depending on fairly interminate factors, sometimes the micronaut-http-netty version will be returned, and sometimes the micronaut-http version will be.

I think the correct response would be to delete the file micronaut-core/http/src/main/resources/META-INF/services/io.micronaut.http.cookie.CookieFactory

This should allow the micronaut-http-netty copy to be used if present, and then fallback will work if it's not.

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

4.3, 4.4

@sdelamo
Copy link
Collaborator

sdelamo commented Apr 29, 2024

It will be fixed via #10775

@sdelamo sdelamo linked a pull request Apr 29, 2024 that will close this issue
@sdelamo sdelamo added the type: bug Something isn't working label Apr 29, 2024
@jeremyg484 jeremyg484 self-assigned this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants