ITeye博客

python3.7 “malformed header from script”错误

Cash · 2019-03-05 10:57 · 编程语言 · Markdown

最近测试python编程登陆,发现apache总是报错 malformed header from script 'login_check.py': Bad header: 1, referer: http://127.0.0.1/login.html

查阅很多文章需要把头部输出调整为 print("Content-type:text/html\n\n")

但始终未果,最后在日志中发现错误重要信息: Bad header: 1, #这个“1”是因为引用了自建的函数py文件中多输出了一个测试“1”字符,导致目前的py文件调用时,在print("Content-type:text/html\n\n")执行前,输出了一个“1”导致整个输出头部失败!

故障排查了1天时间,才发现这个问题!

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。