web.py返回的html,chrome不解析

刚搞的ECS服务器,用web.py从服务器返回来的html文件,ie和edge可以正常解析,显示网页,但是chrome和手机上不渲染,仅仅展示html文件源码,求教啊~

<!DOCTYPE HTML>
<html>
<head>
<!-- META TAGS -->
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- STYLES -->
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="css/fullpage.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/custom.css" rel="stylesheet" type="text/css">
<!-- SITE TITLE -->
<title>Merry Christmas!</title>
</head>
<body>

<!-- AUDIO PLAYER -->
<audio class="audio-player" autoplay loop>
    <source src="audio/song.mp3" type="audio/mpeg">
</audio>

<!-- BACKGROUND CONTAINER -->
<div class="bg-container snowy">
    <!-- GLASS BALL -->
    <div class="glass-ball rotate"></div>
    <!-- TOP LIGHT -->
    <div class="top-light"></div>
    <!-- PAGE CONTENT -->
    <div class="page-content">
        <div class="fullpage">
            <!-- HOME SECTION -->
            <div id="home" class="section active">
                <!-- TITLE -->
                <h1 class="snow-text">Merry Christmas!</h1>
            </div>
        </div>
    </div>
</div>

<!-- SCRIPTS  -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/countdown.min.js"></script>
<script type="text/javascript" src="js/jquery.fullpage.min.js"></script>
<script type="text/javascript" src="js/three.canvas.js"></script>
<script type="text/javascript" src="js/snowy.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/custom.js"></script>

</body>
</html>
当前问题共有如下(4)个解决方案
  • 1034022258979439
    1034022258979439

    加个text/html的头

  • jmpews
    jmpews

    您好, 可以查看 web.py 返回 http header 里的内容类型是否为 html.

  • 姬神
    姬神

    看返回的http headers里面的content-type,应该是设置得不对

  • 吴楠.
    吴楠.

    你web.py中需要设置下response的Header中类型为html,否则默认当做text.

上一篇:要实现特定的IP访问阿里云ECS实例,里面的安全组怎么设
下一篇:ECS Windows 系统提示您的帐户已被停用,应该怎么处理?