IE6 IE7 IE8 未按预期方式处理 content-type 为 text/plain 的内容

本文详细解释了在IE6、IE7、IE8等浏览器中,当页面接收的响应头content-type为text/plain时,浏览器如何尝试嗅探页面内容来判断是否可能为HTML文档,并根据特定规则将其解释为HTML文件类型进行渲染。

http://www.w3help.org/zh-cn/causes/CH9002

 

在 IE6 IE7 IE8 中,若一个页面被打开时接收到的响应头的 content-type 为 text/plain,浏览器会尝试嗅探页面文件内实际内容来判断是否可能为一个 HTML 文档,若是则会以 text/html 的方式将页面作为 HTML 文档解释,而不是将其作为纯文本内容处理。

其解析的具体规则为:嗅探文件内实际内容,如果从文件内容起开始计算的 200 个 ASCII 字符内,存在可明显被识别的 HTML、BODY、HEAD、TITLE 标记则,将该文件解释为 HTML 文件类型并渲染出来。

ys@ys-2025:~$ # 添加 NVIDIA 容器运行时仓库 distribution=$(. /etc/os-release; echo $ID$VERSION_ID) \ && curl -s -L https://nvidia.github.io/libnvidia-container/gpgkey | sudo apt-key add - \ && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list # 安装组件 sudo apt-get update sudo apt-get install -y nvidia-container-toolkit Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). OK <!doctype html> <html lang="en-US"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="chrome=1"> <!-- Begin Jekyll SEO tag v2.8.0 --> <title>Unsupported distribution or misconfigured repository settings | NVIDIA Container Toolkit</title> <meta name="generator" content="Jekyll v3.10.0" /> <meta property="og:title" content="Unsupported distribution or misconfigured repository settings" /> <meta property="og:locale" content="en_US" /> <meta name="description" content="A collection of utilities for using NVIDIA GPUs in containerized environments." /> <meta property="og:description" content="A collection of utilities for using NVIDIA GPUs in containerized environments." /> <link rel="canonical" href="https://nvidia.github.io/libnvidia-container/404.html" /> <meta property="og:url" content="https://nvidia.github.io/libnvidia-container/404.html" /> <meta property="og:site_name" content="NVIDIA Container Toolkit" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary" /> <meta property="twitter:title" content="Unsupported distribution or misconfigured repository settings" /> <script type="application/ld+json"> {"@context":"https://schema.org","@type":"WebPage","description":"A collection of utilities for using NVIDIA GPUs in containerized environments.","headline":"Unsupported distribution or misconfigured repository settings","url":"https://nvidia.github.io/libnvidia-container/404.html"}</script> <!-- End Jekyll SEO tag --> <link rel="stylesheet" href="/libnvidia-container/assets/css/style.css?v=79609cacbfe2969656c0c426bf1fc89ec3eadddd"> <meta name="viewport" content="width=device-width"> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div class="wrapper"> <header> <img src="/libnvidia-container/assets/logo.jpg"> <h1>NVIDIA Container Toolkit</h1> <p>A collection of utilities for using NVIDIA GPUs in containerized environments. </p> <p class="view"><a href="https://github.com/NVIDIA/libnvidia-container">View the Project on GitHub <small></small></a></p> </header> <section> <h1 id="unsupported-distribution-or-misconfigured-repository-settings">Unsupported distribution or misconfigured repository settings</h1> <p>If you are seeing this message, it may mean that your are using an <a href="https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#linux-distributions">unsupported distribution</a>.</p> <p>It may also mean that your repositories are incorrectly configured.</p> <p>In order to simplify the release process for the NVIDIA Container Toolkit and its components, we rely on a set of reference repositories which can be used across a number of distributions. The main references repositories and their compatible distributions are (this is not a complete list):</p> <h2 id="generic-deb-package-repository">Generic .deb package repository</h2> <h3 id="compatible-with">Compatible with</h3> <p>Most distributions that use DEB packages. These include:</p> <ul> <li>Ubuntu</li> <li>Debian</li> </ul> <h3 id="repository-list-urls">Repository list URLs</h3> <ul> <li><code class="language-plaintext highlighter-rouge">https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list</code></li> <li><code class="language-plaintext highlighter-rouge">https://nvidia.github.io/libnvidia-container/experimental/deb/nvidia-container-toolkit.list</code></li> </ul> <h3 id="repository-roots">Repository roots</h3> <ul> <li><code class="language-plaintext highlighter-rouge">https://nvidia.github.io/libnvidia-container/stable/deb</code></li> <li><code class="language-plaintext highlighter-rouge">https://nvidia.github.io/libnvidia-container/experimental/deb</code></li> </ul> <h2 id="generic-rpm-pakcage-repository">Generic .rpm pakcage repository</h2> <h3 id="compatible-with-1">Compatible with</h3> <p>Most distributions that use RPM packages. These include:</p> <ul> <li>RHEL</li> <li>Fedora</li> </ul> <h3 id="repository-file-urls">Repository file URLs</h3> <ul> <li><code class="language-plaintext highlighter-rouge">https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo</code></li> <li><code class="language-plaintext highlighter-rouge">https://nvidia.github.io/libnvidia-container/experimental/rpm/nvidia-container-toolkit.repo</code></li> </ul> <h3 id="repository-roots-1">Repository roots</h3> <ul> <li><code class="language-plaintext highlighter-rouge">https://nvidia.github.io/libnvidia-container/stable/rpm</code></li> <li><code class="language-plaintext highlighter-rouge">https://nvidia.github.io/libnvidia-container/experimental/rpm</code></li> </ul> <h2 id="github-pages-repository-structure">GitHub Pages repository structure</h2> <p>The packages here are served from the <a href="https://github.com/NVIDIA/libnvidia-container/tree/gh-pages/"><code class="language-plaintext highlighter-rouge">gh-pages</code> branch</a> of the <code class="language-plaintext highlighter-rouge">github.com/NVIDIA/libnvidia-container</code> repository. The repository folder structure maps directly to the package manager URLs.</p> <p>For example, the repositories discused above can be found at:</p> <ul> <li><code class="language-plaintext highlighter-rouge">stable/deb</code>: https://github.com/NVIDIA/libnvidia-container/tree/gh-pages/stable/deb</li> <li><code class="language-plaintext highlighter-rouge">experimental/deb</code>: https://github.com/NVIDIA/libnvidia-container/tree/gh-pages/experimental/deb</li> <li><code class="language-plaintext highlighter-rouge">stable/rpm</code>: https://github.com/NVIDIA/libnvidia-container/tree/gh-pages/stable/rpm</li> <li><code class="language-plaintext highlighter-rouge">experimental/rpm</code>: https://github.com/NVIDIA/libnvidia-container/tree/gh-pages/experimental/rpm</li> </ul> <p>This also means that packages can be downloaded directly by appending the package filename to the following URLs:</p> <ul> <li><code class="language-plaintext highlighter-rouge">https://raw.githubusercontent.com/NVIDIA/libnvidia-container/gh-pages/stable/deb/amd64/</code></li> <li><code class="language-plaintext highlighter-rouge">https://raw.githubusercontent.com/NVIDIA/libnvidia-container/gh-pages/experimental/deb/amd64/</code></li> <li><code class="language-plaintext highlighter-rouge">https://raw.githubusercontent.com/NVIDIA/libnvidia-container/gh-pages/stable/rpm/amd64/</code></li> <li><code class="language-plaintext highlighter-rouge">https://raw.githubusercontent.com/NVIDIA/libnvidia-container/gh-pages/experimental/rpm/amd64/</code></li> </ul> </section> <footer> <p>This project is maintained by <a href="https://github.com/NVIDIA">NVIDIA</a></p> <p><small>Copyright (c) 2017, NVIDIA CORPORATION.<br/>All rights reserved.</small></p> </footer> </div> <script src="/libnvidia-container/assets/js/scale.fix.js"></script> </body> </html> E: 软件源列表 /etc/apt/sources.list.d/nvidia-container-toolkit.list 第 1 行中的类别 “<!doctype” 无法识别 E: 无法读取源列表。 E: 软件源列表 /etc/apt/sources.list.d/nvidia-container-toolkit.list 第 1 行中的类别 “<!doctype” 无法识别 E: 无法读取源列表。
最新发布
12-17
在网站开发中不免因为各种兼容问题苦恼,针对兼容问题,其实IE给出了解决方案Google也给出了解决方案 百度也应用了这种方案去解决IE的兼容问题 百度源代码如下 百度一下,你就知道 var wpo={start:new Date*1,pid:109,page:‘superpage’} 可以打开百度,右键查看源码看下!我们可以看下文件头是否存在这样一行代码! 这句话的意思是强制使用IE7模式来解析网页代码! 在这里送上几种IE使用模式! 2. Google Chrome Frame也可以让IE用上Chrome的引擎: 3.强制IE8使用IE7模式来解析 //或者 4.强制IE8使用IE6IE5模式来解析 5.如果一个特定版本的IE支持所要求的兼容性模式多于一种,如: 二.设定网站服务器以指定预设兼容性模式 如果服务器是自己的话,可以在服务器上定义一个自订标头来为它们的网站预设一个特定的文件兼容性模式。这个特定的方法取决于你的网站服务器。 录入,下列的 web.config文件使Microsoft Internet Information Services (IIS)能定义一个自订标头以自动使用IE7 mode来编译所有网页。 另外还有一起其他的解决方案,例如google的 ie7 – js中是一个JavaScript库(解决IE与W3C标准的冲突的JS库),使微软的Internet Explorer的行为像一个Web标准兼容的浏览器,支持更多的W3C标准,支持CSS2、CSS3选择器。它修复了许多的HTML和CSS问题,并使得透明PNG在IE5、IE6下正确显示。 使IE5,IE6兼容到IE7模式(推荐) 使IE5,IE6,IE7兼容到IE8模式 使IE5,IE6,IE7,IE8兼容到IE9模式 解决PNG显示问题 只需将透明png图片命名为*-trans.png 需要注意的是:此方法对背景平铺(background-repeat)和背景(background-position)无法起到任何作用,默认会占满整个容器
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值