treewide: Replace xhtml content type with html, remove xhtml workaround

This commit is contained in:
Igor Scheller 2022-02-20 12:34:57 +01:00
parent bbc00017a9
commit d728f17b8f
8 changed files with 9 additions and 19 deletions

View File

@ -74,8 +74,7 @@ Useful functions:
- *header* (*key*, *value*): Adds an HTTP header to the reply to be sent to - *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. 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 - *prepare_content* (*mime*): Sets the *Content-Type* header to the given MIME
type, potentially setting additional headers or modifying the MIME type to type
accommodate browser quirks
- *write* (*data*, ...): Sends the given data to the client. If headers have not - *write* (*data*, ...): Sends the given data to the client. If headers have not
been sent, it will be done before the data is written. been sent, it will be done before the data is written.

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html lang="">
<head> <head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />

View File

@ -94,10 +94,10 @@ You may obtain a copy of the License at
subtree({path}, root.nodes[category], ...) subtree({path}, root.nodes[category], ...)
end end
http:prepare_content("application/xhtml+xml") http:prepare_content("text/html")
-%> -%>
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> <html lang="">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" media="screen" href="/static/gluon.css" /> <link rel="stylesheet" type="text/css" media="screen" href="/static/gluon.css" />

View File

@ -1,8 +1,8 @@
<%- <%-
http:prepare_content("application/xhtml+xml") http:prepare_content("text/html")
-%> -%>
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> <html lang="">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" /> <meta name="viewport" content="width=device-width, user-scalable=no" />

View File

@ -118,10 +118,10 @@
) )
end end
http:prepare_content("application/xhtml+xml") http:prepare_content("text/html")
-%> -%>
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> <html lang="">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" /> <meta name="viewport" content="width=device-width, user-scalable=no" />

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html lang="">
<head> <head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />

View File

@ -1,7 +1,6 @@
<div id="<%=id%>" class="gluon-osm-map" style="display: none"></div> <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" src="/static/gluon-web-osm.js"></script>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[
(function() { (function() {
var elMap = document.getElementById(<%=json(id)%>); var elMap = document.getElementById(<%=json(id)%>);
var wrapper = elMap.parentNode; var wrapper = elMap.parentNode;
@ -42,5 +41,4 @@
}); });
}); });
})(); })();
//]]>
</script> </script>

View File

@ -78,13 +78,6 @@ end
function Http:prepare_content(mime) function Http:prepare_content(mime)
if self.headers["content-type"] then return end 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) self:header("Content-Type", mime)
end end