Using 1stMUD3.9 version and currently would like to get the webserver to work correctly. It uses +5 of my mud port. Example I use port 4500 and the port the webserver uses is 4505. When I go to my site.. http://worldofrevenge.org:4505 it gives me the html script and not the full page that it should display. I don't understand why it's doing this and not displaying the html correctly. Any suggestions would be greatly appreciated..
Please email me at email@example.com with any suggestions!
I ran into something like this. Firefox at some point started being finicky about content type and your typical home-brew web server in a mud wasn't put together by someone really into standards compliance.
The way I fixed it was by adding the content header as prefix to any page sent, like so:
HTTP/1.0 200 OK\nContent-Type: text/html\r\n\r\n
Note the double CRLF at the end there, that's important to delimit the end of your HTTP header.
Kind of annoying that other browsers are happy to assume content based on file extension but Firefox has to be analer than thou.
In fairness, probably your web server should hew to some basic standards :)
I would prefer if no browsers attempted to render a document that doesn't include content-type. The issue rarely comes up, since most reasonable people use web servers that do the header formation for you. The browser hits a route and gets bytes of data back. Which may or may not be derived from a file. However, the browser isn't privy to this, or to the file for that matter. The route may contain an extension in some cases. "www.somesite.com/index.html" I don't believe other than content-type there is any way other than just guessing/assuming html to divine the file extension if not given. In this case it was not given.
Anyways, you'll end up finding a lot of situations where in some browsers if you're missing things that are said to be essential it just won't work. For example, forgetting the title tag in the document header can cause serious problems in some browsers and work fine in others.
It's good practice to run the page through a validator even if it's working for you. Because, as you've seen, invalid pages can cause issues in other browsers. The old "liberal in what you accept, conservative in what you send" thing may ring true, but remember…most importantly is upholding what you have control over. Being conservative in what you send. We can't really complain that more browsers didn't accept our invalid data. :p