[luci] luci.http.header don't works
Lay András
andras at lay.hu
Fri Apr 20 13:25:54 CEST 2012
Hello!
I'd like to write some pages under OpenWrt, but i can't set the http
content-type header. Here is my code:
-------------------------------------------------------------------------------------------
#!/usr/bin/lua
require'luci.http'
luci.http.header('Content-Type','text/html; charset=utf-8')
print'<!DOCTYPE html>'
print'<html>'
print'<head>'
print'<meta charset="utf-8">'
print'<title>Fejléc</title>'
print'</head>'
print'<body>'
print'<p>Tartalom</p>'
print'</body>'
print'</html>'
-------------------------------------------------------------------------------------------
But this doesn't works. If i comment the luci.http.... line, it works,
but the content type is test/plain, so it prints the html tags. How
can i set http content-type header?
Thank you!
More information about the luci
mailing list