You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/04/11 23:06:12 UTC
svn commit: r1738644 - in /tomcat/tc8.5.x/trunk: ./
java/org/apache/coyote/Response.java webapps/docs/changelog.xml
Author: markt
Date: Mon Apr 11 21:06:12 2016
New Revision: 1738644
URL: http://svn.apache.org/viewvc?rev=1738644&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=59295
Use Locale.toLangaugeTag() to construct the Content-Langauge HTTP header to ensure the locale is correctly represented.
Patch provided by zikfat.
Modified:
tomcat/tc8.5.x/trunk/ (props changed)
tomcat/tc8.5.x/trunk/java/org/apache/coyote/Response.java
tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc8.5.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 21:06:12 2016
@@ -1 +1 @@
-/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480,1735577,1735597,1735599-1735600,1735615,1736145,1736162,1736209,1736280,1736297,1736299,1736489,1736646,1736703,1736836,1736849,1737104-1737105,1737112,1737117,1737119-1737120,1737155,1737157,1737192,1737280,1737339,1737632,1737664,1737715,1737748,1737785,1737834,1737860,1737959,1738005,1738007,1738014-1738015,1738018,1738022,1738039,1738043,1738059-1738060,1738147,1738149,1738174-1738175,1738261,1738589,1738623-1738625
+/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480,1735577,1735597,1735599-1735600,1735615,1736145,1736162,1736209,1736280,1736297,1736299,1736489,1736646,1736703,1736836,1736849,1737104-1737105,1737112,1737117,1737119-1737120,1737155,1737157,1737192,1737280,1737339,1737632,1737664,1737715,1737748,1737785,1737834,1737860,1737959,1738005,1738007,1738014-1738015,1738018,1738022,1738039,1738043,1738059-1738060,1738147,1738149,1738174-1738175,1738261,1738589,1738623-1738625,1738643
Modified: tomcat/tc8.5.x/trunk/java/org/apache/coyote/Response.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/coyote/Response.java?rev=1738644&r1=1738643&r2=1738644&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/java/org/apache/coyote/Response.java (original)
+++ tomcat/tc8.5.x/trunk/java/org/apache/coyote/Response.java Mon Apr 11 21:06:12 2016
@@ -379,17 +379,7 @@ public final class Response {
this.locale = locale;
// Set the contentLanguage for header output
- contentLanguage = locale.getLanguage();
- if ((contentLanguage != null) && (contentLanguage.length() > 0)) {
- String country = locale.getCountry();
- StringBuilder value = new StringBuilder(contentLanguage);
- if ((country != null) && (country.length() > 0)) {
- value.append('-');
- value.append(country);
- }
- contentLanguage = value.toString();
- }
-
+ contentLanguage = locale.toLanguageTag();
}
/**
Modified: tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml?rev=1738644&r1=1738643&r2=1738644&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml Mon Apr 11 21:06:12 2016
@@ -142,6 +142,11 @@
<bug>59289</bug>: Do not recycle upgrade processors in unexpected close
situations. (remm)
</fix>
+ <fix>
+ <bug>59295</bug>: Use <code>Locale.toLangaugeTag()</code> to construct
+ the <code>Content-Langauge</code> HTTP header to ensure the locale is
+ correctly represented. Patch provided by zikfat. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="WebSocket">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org