projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e1ec77
)
libs/web: Corrected HTTP-Headers
author
Steven Barth
<steven@midlink.org>
Wed, 20 Aug 2008 19:24:09 +0000
(19:24 +0000)
committer
Steven Barth
<steven@midlink.org>
Wed, 20 Aug 2008 19:24:09 +0000
(19:24 +0000)
libs/web/luasrc/http.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/http.lua
b/libs/web/luasrc/http.lua
index 4fa6438653d8154d5ab59ac92b7a0a50aa7a2e91..5b922d99438b14863b87b8b8901c8f6fc7e97cbe 100644
(file)
--- a/
libs/web/luasrc/http.lua
+++ b/
libs/web/luasrc/http.lua
@@
-172,6
+172,13
@@
end
--- Set the mime type of following content data.
-- @param mime Mimetype of following content
function prepare_content(mime)
+ if mime == "application/xhtml+xml" then
+ if not getenv("HTTP_ACCEPT") or
+ not getenv("HTTP_ACCEPT"):find("application/xhtml+xml", nil, true) then
+ mime = "text/html; charset=UTF-8"
+ end
+ header("Vary", "Accept")
+ end
header("Content-Type", mime)
end