Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

HTML displays as text only from the web

  • 4 trả lời
  • 0 gặp vấn đề này
  • 87 lượt xem
  • Trả lời mới nhất được viết bởi Questor

more options

I have a dozen old embedded device modules (circa 2003) which can host a web page. When I access the device through my local intranet (192.168.0.xxx), the web page displays correctly. However, when the same page is accessed through my DNS service (xxx.gotdns.org:xxxx) over the web, the Firefox INSPECT:network tool indicates that the document is type:text and displays the HTML in a text format. The first line of the HTML document is :<!DOCTYPE html>.....

These devices are non-secure information-only devices, but at least Firefox allows for HTTP: exceptions.

However, I cannot understand why Firefox treats the same content differently depending on the path. Is there a way to force Firefox to actually look at the contents of the packet and treat it accordingly?

I have a dozen old embedded device modules (circa 2003) which can host a web page. When I access the device through my local intranet (192.168.0.xxx), the web page displays correctly. However, when the same page is accessed through my DNS service (xxx.gotdns.org:xxxx) over the web, the Firefox INSPECT:network tool indicates that the document is type:text and displays the HTML in a text format. The first line of the HTML document is :&lt;!DOCTYPE html&gt;..... These devices are non-secure information-only devices, but at least Firefox allows for HTTP: exceptions. However, I cannot understand why Firefox treats the same content differently depending on the path. Is there a way to force Firefox to actually look at the contents of the packet and treat it accordingly?

Được chỉnh sửa bởi cor-el vào

Giải pháp được chọn

Thanx Jeff, What threw me off-course was that browsers treated content differently. What I should have been looking at was a "simple" web site that I could capture with WireShark. It's almost impossible to find a "Simple" site.

I made some progress. The SitePlayer device (circa 2002) is just too old and does not preface a GET response with the new required information. More up-to-date servers add the following:


HTTP/1.0 200 OK Pragma: no-cache Content-Type: text/html


So, I added the proper lines to the HTML file and it loaded properly. Without access to the Siteplayer Source Code, it's the best I can do.....

Đọc câu trả lời này trong ngữ cảnh 👍 0

Tất cả các câu trả lời (4)

more options

This likely means that the web server software you are using doesn't send .htm(l) files as text/html, but sends them as text/plain like you noticed. You need to check the docs of that server software to see how to configure the server.

more options

Sorry, this doesn't explain why Firefox (even as early as 35.0.1) treats identical web pages differently depending on the network path. Attached is an image of a simple web page that worked OK locally, but not via the internet.

A. To allow off-site access to intranet devices, I use my Router Port Forwarding with a DNS server which routes requests to port 80. Any problems with this?? B. it does work on older versions of Win-7 Internet Explorer ver 11. C It doesn't work with MS Edge, something about an invalid HTTP Response, but I don't use Edge.... D. I used WireShark to capture the 2 conversations and, with the exception of the source address, the content was the same.

Được chỉnh sửa bởi Questor vào

more options

Open the Network Monitor panel (Ctrl+Shift+E) and then load or reload the page. Click the row that has the main page request and in the pane on the right side, check the Response Headers for the Content-Type. It would make no sense for the Content-Type to be text/html in one case and text/plain in the other, but that sounds like what Firefox is receiving. What do you see?

more options

Giải pháp được chọn

Thanx Jeff, What threw me off-course was that browsers treated content differently. What I should have been looking at was a "simple" web site that I could capture with WireShark. It's almost impossible to find a "Simple" site.

I made some progress. The SitePlayer device (circa 2002) is just too old and does not preface a GET response with the new required information. More up-to-date servers add the following:


HTTP/1.0 200 OK Pragma: no-cache Content-Type: text/html


So, I added the proper lines to the HTML file and it loaded properly. Without access to the Siteplayer Source Code, it's the best I can do.....