diff --git a/docs/dev/web/controller.rst b/docs/dev/web/controller.rst index 3f63ef01a46c431e570c1a8675712d9ef37e402f..2f0ab733ae213c89b79acbaab559614b0682471f 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 292129f6e1f47b5c8919f395f49acf8769239243..8b29b2b4b7a4515d4777027428255c08c2ff2aa3 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 @@ <!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> +<html lang=""> <head> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> 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 c80cd4b38af86a25652789b24bf43f1e7e1653b6..47d66cb6f1fbe3cf51cea560166ec608f1761980 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") -%> <!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<html lang=""> <head> <meta charset="UTF-8" /> <link rel="stylesheet" type="text/css" media="screen" href="/static/gluon.css" /> 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 11969ddc2f527915493be6b27d179f3947611a2b..7b33bd93b31bc6927804c44af5fcc5c73fd87b84 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") -%> <!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<html lang=""> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, user-scalable=no" /> 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 6957599f37803637d3a14c89e4630c1442874fa3..16fbaa5dcb291a2a8fe63cfe73f64245f001d40e 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") -%> <!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<html lang=""> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, user-scalable=no" /> 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 cc209cece61063952e2d3fb17ea16fa6311728d6..b360a712cbdfc4d7417466fcc4708dfe1dc52279 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 @@ <!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> +<html lang=""> <head> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> 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 a2822cd4420bc691c43fe9851152ef23edbdee7f..2caa3f379161d18a03c16cdf48341b57a9cd4581 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 @@ <div id="<%=id%>" class="gluon-osm-map" style="display: none"></div> <script type="text/javascript" src="/static/gluon-web-osm.js"></script> <script type="text/javascript"> - //<![CDATA[ (function() { var elMap = document.getElementById(<%=json(id)%>); var wrapper = elMap.parentNode; @@ -42,5 +41,4 @@ }); }); })(); - //]]> </script> 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 c77d4ace01ea44face7f07b6e11340b29c80ae40..eae38bff30f8d4a3ac23d1923db77812671f2e56 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