Python 随着时间的推移,简单的Flask应用程序和错误的HTTP/0.9请求类型
我编写了一个简单的flask应用程序,如下所示:它非常简约,只有三个页面和登录表单。我在自己的电脑上运行这个应用程序。有时一天中我会收到这样的信息:Python 随着时间的推移,简单的Flask应用程序和错误的HTTP/0.9请求类型,python,flask,Python,Flask,我编写了一个简单的flask应用程序,如下所示:它非常简约,只有三个页面和登录表单。我在自己的电脑上运行这个应用程序。有时一天中我会收到这样的信息: 178.93.*.* - - [27/Jun/2013 07:28:45] code 400, message Bad HTTP/0.9 request type ('\x99L\xe6\x1f\x9a\xbb\x8d\xea\x1d\xfa\x96_\x8e\x88\xc1\xfc_q\x8d:h\x88\x12\xda\xcb\x1a4X\xa
178.93.*.* - - [27/Jun/2013 07:28:45] code 400, message Bad HTTP/0.9 request type ('\x99L\xe6\x1f\x9a\xbb\x8d\xea\x1d\xfa\x96_\x8e\x88\xc1\xfc_q\x8d:h\x88\x12\xda\xcb\x1a4X\xa7\xe3;\x1e\x1a\xd1w')
178.93.*.* - - [27/Jun/2013 07:28:45] "�L�������_��_q�:h���4X��;�w ���|G�(+��g��(RhԱ����" 400 -
我的索引函数如下:
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
if database.get_user(request.form['login']):
session['username'] = request.form['login']
return redirect(url_for('list_site'))
elif request.form['login'] == app.config['USERNAME']:
if request.form['password'] == app.config['PASSWORD']:
session['logged_in_admin'] = True
return redirect(url_for('admin_site'))
return render_template('index.html')
有时服务器没有响应,我必须重新启动应用程序。有人能帮我吗?关闭所有浏览器扩展,然后再试一次。@falsetru这不是我的ip,当我要访问站点时,一切正常。有时某些ip生成了这个错误的请求。@user84471,你是如何解决这个问题的?@uttam这是因为我有https而不是http请求。