Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why do I see the source code (html) of some web pages?

Tags:

html

firefox

Most web pages are normally parsed and of course I don't see tags like <html> or <a href=>.

But, when I open some web sites, the source code pops up.

Try this

http://mediacomp-jes.googlecode.com/svn-history/r68/jes/JESHelp/auxHelp/mediaToolsOverview.html

So I saved this web page and reopened locally using firefox, everything seems normal again.

any reasons?

like image 897
digit plumber Avatar asked Dec 01 '25 08:12

digit plumber


2 Answers

You're viewing the file in an SVN repository browser. They must have the encoding for the documents in these directories set to render as plain text. I am using chrome and saw the same thing. It's by design in this case.

like image 74
Batkins Avatar answered Dec 05 '25 21:12

Batkins


As everybody says, it is the server side (Apache) configuration. You can confirm this by issuing HEAD request.

curl -I http://mediacomp-jes.googlecode.com/svn-history/r68/jes/JESHelp/auxHelp/mediaToolsOverview.html

returns

HTTP/1.1 200 OK
Date: Thu, 29 Dec 2011 00:27:49 GMT
Server: Apache
Last-Modified: Thu, 16 Oct 2008 18:13:57 GMT
ETag: "2//jes/JESHelp/auxHelp/mediaToolsOverview.html"
Accept-Ranges: bytes
Expires: Thu, 29 Dec 2011 00:30:49 GMT
Content-Length: 1802
Content-Type: text/plain
Cache-Control: public, max-age=180
Age: 0

Notice that Content-Type says "text/plain"

like image 24
barley Avatar answered Dec 05 '25 21:12

barley