From d728f17b8fc848b35e93eebb8e948798a1e4440a Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 20 Feb 2022 12:34:57 +0100 Subject: [PATCH] treewide: Replace xhtml content type with html, remove xhtml workaround --- docs/dev/web/controller.rst | 3 +-- .../files/lib/gluon/config-mode/www/index.html | 2 +- .../files/lib/gluon/config-mode/view/theme/layout.html | 4 ++-- .../files/lib/gluon/status-page/view/layout.html | 4 ++-- .../files/lib/gluon/status-page/view/status-page.html | 4 ++-- .../files/lib/gluon/status-page/www/index.html | 2 +- .../files/lib/gluon/web/view/model/osm/map.html | 2 -- package/gluon-web/luasrc/usr/lib/lua/gluon/web/http.lua | 7 ------- 8 files changed, 9 insertions(+), 19 deletions(-) diff --git a/docs/dev/web/controller.rst b/docs/dev/web/controller.rst index 3f63ef01..2f0ab733 100644 --- a/docs/dev/web/controller.rst +++ b/docs/dev/web/controller.rst @@ -74,8 +74,7 @@ Useful functions: - *header* (*key*, *value*): Adds an HTTP header to the reply to be sent to the client. Has no effect when non-header data has already been written. - *prepare_content* (*mime*): Sets the *Content-Type* header to the given MIME - type, potentially setting additional headers or modifying the MIME type to - accommodate browser quirks + type - *write* (*data*, ...): Sends the given data to the client. If headers have not been sent, it will be done before the data is written. diff --git a/package/gluon-config-mode-core/files/lib/gluon/config-mode/www/index.html b/package/gluon-config-mode-core/files/lib/gluon/config-mode/www/index.html index 292129f6..8b29b2b4 100644 --- a/package/gluon-config-mode-core/files/lib/gluon/config-mode/www/index.html +++ b/package/gluon-config-mode-core/files/lib/gluon/config-mode/www/index.html @@ -1,5 +1,5 @@ - + diff --git a/package/gluon-config-mode-theme/files/lib/gluon/config-mode/view/theme/layout.html b/package/gluon-config-mode-theme/files/lib/gluon/config-mode/view/theme/layout.html index c80cd4b3..47d66cb6 100644 --- a/package/gluon-config-mode-theme/files/lib/gluon/config-mode/view/theme/layout.html +++ b/package/gluon-config-mode-theme/files/lib/gluon/config-mode/view/theme/layout.html @@ -94,10 +94,10 @@ You may obtain a copy of the License at subtree({path}, root.nodes[category], ...) end - http:prepare_content("application/xhtml+xml") + http:prepare_content("text/html") -%> - + diff --git a/package/gluon-status-page/files/lib/gluon/status-page/view/layout.html b/package/gluon-status-page/files/lib/gluon/status-page/view/layout.html index 11969ddc..7b33bd93 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/view/layout.html +++ b/package/gluon-status-page/files/lib/gluon/status-page/view/layout.html @@ -1,8 +1,8 @@ <%- - http:prepare_content("application/xhtml+xml") + http:prepare_content("text/html") -%> - + diff --git a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html index 6957599f..16fbaa5d 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html +++ b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html @@ -118,10 +118,10 @@ ) end - http:prepare_content("application/xhtml+xml") + http:prepare_content("text/html") -%> - + diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/index.html b/package/gluon-status-page/files/lib/gluon/status-page/www/index.html index cc209cec..b360a712 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/www/index.html +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/index.html @@ -1,5 +1,5 @@ - + diff --git a/package/gluon-web-osm/files/lib/gluon/web/view/model/osm/map.html b/package/gluon-web-osm/files/lib/gluon/web/view/model/osm/map.html index a2822cd4..2caa3f37 100644 --- a/package/gluon-web-osm/files/lib/gluon/web/view/model/osm/map.html +++ b/package/gluon-web-osm/files/lib/gluon/web/view/model/osm/map.html @@ -1,7 +1,6 @@ diff --git a/package/gluon-web/luasrc/usr/lib/lua/gluon/web/http.lua b/package/gluon-web/luasrc/usr/lib/lua/gluon/web/http.lua index c77d4ace..eae38bff 100644 --- a/package/gluon-web/luasrc/usr/lib/lua/gluon/web/http.lua +++ b/package/gluon-web/luasrc/usr/lib/lua/gluon/web/http.lua @@ -78,13 +78,6 @@ end function Http:prepare_content(mime) if self.headers["content-type"] then return end - if mime == "application/xhtml+xml" then - local accept = self:getenv("HTTP_ACCEPT") - if not accept or not accept:find("application/xhtml+xml", nil, true) then - mime = "text/html; charset=UTF-8" - end - self:header("Vary", "Accept") - end self:header("Content-Type", mime) end