Skip to content
Snippets Groups Projects
Commit d728f17b authored by Igor Scheller's avatar Igor Scheller
Browse files

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

parent bbc00017
Branches
Tags
No related merge requests found
...@@ -74,8 +74,7 @@ Useful functions: ...@@ -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.
......
<!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" />
......
...@@ -94,10 +94,10 @@ You may obtain a copy of the License at ...@@ -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" />
......
<%- <%-
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" />
......
...@@ -118,10 +118,10 @@ ...@@ -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" />
......
<!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" />
......
<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 @@ ...@@ -42,5 +41,4 @@
}); });
}); });
})(); })();
//]]>
</script> </script>
...@@ -78,13 +78,6 @@ end ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment