christian Muller
christian Muller

Reputation: 5056

Firefox/Opera show HTML page Source instead Content?

I created a simple HTML Server with LUA (corona environment)

Anyhow while connecting from Safari/Chrome the Page is displayed fine, but with Opera/Firefox, I get instead the Source Code shown instead??

Do i have to send kind a PreHeader or what can be the reason.

For example

<html>
  <body>
     hello <strong>test</strong> how are you
  </body>
</html>

Safari/Chrome does show as expected just: " hello test how are you "

But Opera/Firefox does show the source itself as example above!!?

Any Ideas

Update: Now I implemented a meta tag Content Header.... still the same !! Firefox/opera do show the source instead the content.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
     <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
 </head>
 <body>
   testa asdfa asf asdf asdf asdf
 </body>
 </html>

Upvotes: 1

Views: 2358

Answers (3)

christian Muller
christian Muller

Reputation: 5056

ok.. solved it... had to send

    client:send("HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n")

before anything else

Upvotes: 1

JScoobyCed
JScoobyCed

Reputation: 10413

In the HTTP response (from the server), you need to send the Content-Type header, i.e.

Content-Type:   text/html

Upvotes: 1

John Chadwick
John Chadwick

Reputation: 3213

Your problem is almost certainly because you have not sent the Content-type header. You'll want to try to send it somehow. Set it to text/html.

Upvotes: 0

Related Questions