[!!!][FEATURE] "Content-Language" HTTP header now added when rendering 65/40265/5
authorRomain L <rolel@smile.fr>
Mon, 15 Jun 2015 17:54:10 +0000 (19:54 +0200)
committerBenjamin Mack <benni@typo3.org>
Tue, 16 Jun 2015 16:02:23 +0000 (18:02 +0200)
The "Content-Language" is now sent as a both meta tag and HTTP header.
Previously page language information was only sent as meta tag.

By default new and existing installations will send a header
"Content-language: XX" where "XX" is the iso code of the
sys_language_content if that is properly defined by the sys_language
record representing the sys_language_uid.
A new Typoscript configuration "config.disableLanguageHeader" allows
to disable this behavior.
You must set "config.disableLanguageHeader" to get the previous
behavior (no header).

Resolves: #33071
Releases: master
Change-Id: I2de9ad3deb93b9e2266ff03cb68d3fb60250bf41
Reviewed-on: http://review.typo3.org/40265
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Frederic Gaus <frederic.gaus@flagbit.de>
Tested-by: Frederic Gaus <frederic.gaus@flagbit.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Feature-33071-AddTheHttpHeaderContent-LanguageWhenRenderingAPage.rst [new file with mode: 0644]

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-33071-AddTheHttpHeaderContent-LanguageWhenRenderingAPage.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-33071-AddTheHttpHeaderContent-LanguageWhenRenderingAPage.rst
new file mode 100644 (file)
index 0000000..baa7c8a
--- /dev/null
@@ -0,0 +1,17 @@
+Feature: #33071 - Add the http header "Content-Language" when rendering a page
+By default a header "Content-language: XX" is sent where "XX" is the iso code of the sys_language_content if that is properly defined by the sys_language record representing the sys_language_uid.
+The "config.disableLanguageHeader" will disable that.
+By default new and existing installations a header "Content-language: XX" is sent where "XX" is the iso code of the sys_language_content if that is properly defined by the sys_language record representing the sys_language_uid.
+You must set "config.disableLanguageHeader" to disable that and get previous behavior (no header).
\ No newline at end of file
index 274d92b..7b22d46 100644 (file)
@@ -3615,6 +3615,11 @@ class TypoScriptFrontendController {
                        $headLine = 'Content-Type: ' . $this->contentType . '; charset=' . trim($this->metaCharset);
+               // Set header for content language unless disabled
+               if (empty($this->config['config']['disableLanguageHeader']) && !empty($this->sys_language_isocode)) {
+                       $headLine = 'Content-Language: ' . trim($this->sys_language_isocode);
+                       header($headLine);
+               }
                // Set cache related headers to client (used to enable proxy / client caching!)
                if (!empty($this->config['config']['sendCacheHeaders'])) {