admin管理员组

文章数量:1414908

I am using GlassFish 7 (version 7.0.21) with JDK 17 (jdk-17.0.11+9) to deploy a Jakarta EE application generated using Jakarta EE Starter.

I encountered an issue where URLs containing non-ASCII characters (e.g., Chinese characters) return different responses depending on the HTTP version:

  • HTTP/1.1: /%E6%B8%AC%E8%A9%A6 → returns 200 (works fine)
  • HTTP/2.0: /%E6%B8%AC%E8%A9%A6 → returns 404 (not found) The issue only occurs under HTTPS (HTTP/2.0). When using HTTP (HTTP/1.1), the request works correctly.

In access.log GET correctly sends the URL in UTF-8 encoding.

Verified that the client correctly sends the URL in UTF-8 encoding. Use Glassfish access log

The request structure is identical except for the HTTP version. Tested with Different Clients

The issue occurs consistently across multiple browsers (Chrome, Firefox) and curl. Example curl command that works:

  • curl -k -v --http1.1 "/%E6%B8%AC%E8%A9%A6"

Example curl command that fails (404):

  • curl -k -v --http2 "/%E6%B8%AC%E8%A9%A6"

Expected Feedback

  • Has anyone encountered a similar issue with GlassFish 7 and HTTP/2.0?
  • Could this be a bug in GlassFish 7’s handling of non-ASCII characters in HTTP/2.0?
  • Are there any workarounds or additional configurations I can apply to fix this?
  • Should I modify GlassFish settings or Jakarta EE application settings to ensure proper URL encoding under HTTP/2.0?

本文标签: