网页.pysafeunicode函数错误?

2024-06-10 09:29:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我在上面发现了一只虫子网页.pyutils.safeunicode功能。版本是0.36

>>> import web
>>> app=web.application(('/hello','hello'),locals())
>>> class hello:
...   def GET(self):
...       return 'hello world'

#it's the normal request
>>> app.request('/hello').data
'hello world'

#the Error request
>>> app.request('hello\xbf').data
...
UnicodeDecodeError: 'utf8' codec can't decode byte 0xbf in position 6: unexpected code byte

我试了一些网页.py像这样的网站http://web.site/index%bf,所有这些都响应状态500或异常。那么这是一个bug还是一个漏洞?在

我修好了实用工具.py342号线

^{pr2}$

然后一切顺利。但是真的安全吗?在


Tags: theimport功能版本webapp网页hello