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

[3.2.3] broken umlauts in htmx req/resp #39745

Closed
resmo opened this issue Feb 23, 2024 · 14 comments
Closed

[3.2.3] broken umlauts in htmx req/resp #39745

resmo opened this issue Feb 23, 2024 · 14 comments
Labels
for: external-project For an external project and not something we can fix

Comments

@resmo
Copy link

resmo commented Feb 23, 2024

Summary

I am experiencing an issue I only see with htmx responses that is why I open the issue here, but it might be a spring boot 3.2.3 issue.

After switching form spring boot 3.2.2 to 3.2.3 I see broken "umlauts". Switching back to 3.2.2 shows correct "umlauts".

Screenshot from 2024-02-23 17-49-30

Response header looks fine, content "looks" identical but the weird thing is that the content length is different, off by 1 B (3.2.3 has -1 B). Unsure if this is the issue.

Spring Boot

3.2.3

Details

3.2.3

HTTP/1.1 200 
Content-Type: text/html;charset=UTF-8
Content-Language: de
Content-Length: 214
Date: Fri, 23 Feb 2024 16:08:47 GMT
Keep-Alive: timeout=60
Connection: keep-alive

3.2.2

HTTP/1.1 200 
Content-Type: text/html;charset=UTF-8
Content-Language: de
Content-Length: 215
Date: Fri, 23 Feb 2024 16:14:01 GMT
Keep-Alive: timeout=60
Connection: keep-alive

I use the Thymeleaf with spring-boot-htmx (and issue also filed there wimdeblauwe/htmx-spring-boot#99).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 23, 2024
@philwebb
Copy link
Member

This is unlikely to be an issue in Spring Boot itself, but it could be caused by a dependency upgrade that we manage. I would suspect Spring Framework or Tomcat would be the most likely candidates.

@resmo Do you have a small reproducer project that you can provide? This might help us identify what's changed.

@philwebb philwebb added the status: waiting-for-feedback We need additional information before we can continue label Feb 23, 2024
@resmo
Copy link
Author

resmo commented Feb 24, 2024

I created a reproducer and can say, that I am only able to reproduce it in 3.2.3 using the helper library io.github.wimdeblauwe -> htmx-spring-boot

reproducer repo https://github.com/resmo/spring-boot-3.2.3-demo-htmx-umlauts

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Feb 24, 2024
@scottfrederick
Copy link
Contributor

@scottfrederick
Copy link
Contributor

@resmo I've tried your reproducer, and I see the umlauts when clicking on both links regardless of the Spring Boot version. I've tested it in Chrome and Firefox, running the app with ./mvnw spring-boot:run or java -jar target/repro-0.0.1-SNAPSHOT.jar. Are there additional instructions for running the app that you can provide?

Also, can you try setting the property <spring-framework.version>6.1.3</spring-framework.version> in the <properties> section of your pom.xml when building against Spring Boot 3.2.3? Framework was upgraded from 6.1.3 to 6.1.4 between Boot 3.2.2 and 3.2.3, so forcing the downgrade with Boot 3.2.3 would help narrow down the root of the problem.

@scottfrederick scottfrederick added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Feb 24, 2024
@resmo
Copy link
Author

resmo commented Feb 24, 2024

@scottfrederick

I've tried your reproducer, and I see the umlauts when clicking on both links regardless of the Spring Boot version. I've tested it in Chrome and Firefox, running the app with ./mvnw spring-boot:run or java -jar target/repro-0.0.1-SNAPSHOT.jar. Are there additional instructions for running the app that you can provide?

very interesting: you did everything the way I did, but as it seems the issue is related to the language setting in the browser: if I change the default language to "english", all umlauts look good. If I change it to "german" or "german (switzerland)", I see the issue.

tested in chromium, firefox on linux and firefox on mac

adding <spring-framework.version>6.1.3</spring-framework.version> to properties in pom does "fix" the issue

I browsed through the list of issues and noticed spring-projects/spring-framework#32317 which looks suspicious. I try to test the snapshot of 6.1.5 once it is available.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Feb 24, 2024
@scottfrederick
Copy link
Contributor

Thanks for the follow-up @resmo. I will close this issue, as it doesn't appear that Spring Boot is the cause.

@scottfrederick scottfrederick closed this as not planned Won't fix, can't repro, duplicate, stale Feb 25, 2024
@scottfrederick scottfrederick added for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Feb 25, 2024
@sbrannen
Copy link
Member

I browsed through the list of issues and noticed spring-projects/spring-framework#32317 which looks suspicious. I try to test the snapshot of 6.1.5 once it is available.

@resmo, please note that 6.1.5-SNAPSHOT builds for Spring Framework are already available.

See spring-projects/spring-framework#32317 (comment) for details.

Feedback is welcome!

@resmo
Copy link
Author

resmo commented Feb 25, 2024

@scottfrederick Thanks for your time.
@sbrannen I tested with spring-core-6.1.5-20240225.154205-16.jar but unfortunately it doesn't resolve the issue.

@wilkinsona
Copy link
Member

wilkinsona commented Feb 26, 2024

Re-opening to continue the investigation. The problem reminds me a little of #32472 and #32472 (comment) in particular. However, unless Tomcat changed its mappings in a maintenance release, I wouldn't expect to see the described change in behavior.

@wilkinsona wilkinsona reopened this Feb 26, 2024
@wilkinsona wilkinsona added status: waiting-for-triage An issue we've not yet triaged and removed for: external-project For an external project and not something we can fix labels Feb 26, 2024
@resmo
Copy link
Author

resmo commented Feb 26, 2024

@wilkinsona let me know if I can help, to me it looks related to accept-language header somehow

@sbrannen
Copy link
Member

sbrannen commented Feb 26, 2024

Andy, I think it might be due to the fact that the content type is now cached.

See the analysis from a user in the linked Framework issue which I’ll investigate this afternoon.

@wilkinsona
Copy link
Member

Thanks, Sam. To avoid duplicating effort, I'll close this one again for now. Let us know how this afternoon's investigation goes. We can re-open this one again if needed.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2024
@wilkinsona wilkinsona added for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 26, 2024
@sbrannen
Copy link
Member

We've pushed a fix for Spring Framework 6.1.x.

See spring-projects/spring-framework#32317 (comment) for details.

@resmo
Copy link
Author

resmo commented Feb 26, 2024

@sbrannen spring-core-6.1.5-20240226.173247-18.jar fixes the issue, umlauts are shown correctly (content-length size is as it was in 6.1.3)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix
Projects
None yet
Development

No branches or pull requests

6 participants