You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Origin.Address.asString(), Strict-Transport-Security and Alt-Svc are formatted with the default Locale (non-ASCII digits)Β #16020
Jetty version(s): 12.0.40, 12.1.14 (and jetty-12.0.x / jetty-12.1.x heads) Jetty Environment: core Java version/vendor: any JDK 9+ (CLDR locale data); reproduced on OpenJDK 25.0.2 OS type/version: any Description
A follow-up to #13419 / #13420, which added Locale.ROOT to the %f and DecimalFormat sites. Three String.format("%d") sites still follow the JVM's default Locale, and on a JVM whose default Locale uses
native digits (for example ar-EG, fa-IR, bn-BD, ne-NP) they produce strings that are not valid on
the wire:
jetty-core/jetty-client/.../Origin.java β Origin.Address.asString() returns String.format("%s:%d", host, port). HttpProxy uses it as the CONNECT request target and the Host header sent to a forward proxy.
jetty-core/jetty-server/.../SecureRequestCustomizer.java β formatSTS() builds String.format("max-age=%d%s", ...); the resulting Strict-Transport-Security: max-age=Ω£Ω‘Ω₯Ω£Ω¦Ω Ω Ω
is silently ignored by browsers, so HSTS is not enforced.
jetty-core/jetty-http2/jetty-http2-server/.../HTTP2ServerConnectionFactory.java (12.1.x only) β
the Alt-Svc header is built with String.format("h3=\":%d\"", port) and String.format("; ma=%d", ...).
The project's surefire configuration pins -Duser.language=en -Duser.region=US, which is why the test
suite never sees it.
How to reproduce?
Against the released 12.1.14 jars (jetty-client, jetty-server and their dependencies):
I have a branch that replaces the three formats with plain concatenation (the values are a String and
an int/long, so no formatting is needed) and adds OriginTest and SecureRequestCustomizerTest
that switch the default Locale to ar-EG around the calls; happy to open it as a PR against jetty-12.0.x (sites 1 and 2) with the Alt-Svc site for jetty-12.1.x.
Activity
lorban commentedon Oct 23, 2026
Thanks for reporting this. I've created a PR with the 12.1.x candidate fix: #16025
#16020 replace formatting with concatenations to avoid involving the β¦
#16020 use Locale.ROOT instead of string concats
#16020 Force using the ROOT locale when formatting to avoid involvingβ¦
#16020 Force using the ROOT locale when formatting to avoid involvingβ¦