第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Django的SuspiciousOperation無(wú)效的HTTP_HOST標(biāo)頭

Django的SuspiciousOperation無(wú)效的HTTP_HOST標(biāo)頭

慕妹3242003 2019-11-27 10:31:21
升級(jí)到Django 1.5后,我開(kāi)始出現(xiàn)如下錯(cuò)誤:Traceback (most recent call last):File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 92, in get_responseresponse = middleware_method(request)File "/usr/local/lib/python2.7/dist-packages/django/middleware/common.py", line 57, in process_requesthost = request.get_host()File "/usr/local/lib/python2.7/dist-packages/django/http/request.py", line 72, in get_host"Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): %s" % host)SuspiciousOperation: Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): www.google.com<WSGIRequestpath:/,GET:<QueryDict: {}>,POST:<QueryDict: {}>,COOKIES:{},META:{'CONTENT_LENGTH': '','CONTENT_TYPE': '','DOCUMENT_ROOT': '/etc/nginx/html','HTTP_ACCEPT': 'text/html','HTTP_HOST': 'www.google.com','HTTP_PROXY_CONNECTION': 'close','HTTP_USER_AGENT': 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)','PATH_INFO': u'/','QUERY_STRING': '','REMOTE_ADDR': '210.245.91.104','REMOTE_PORT': '49347','REQUEST_METHOD': 'GET','REQUEST_URI': '/',u'SCRIPT_NAME': u'','SERVER_NAME': 'www.derekkwok.net','SERVER_PORT': '80','SERVER_PROTOCOL': 'HTTP/1.0','uwsgi.node': 'derekkwok','uwsgi.version': '1.4.4','wsgi.errors': <open file 'wsgi_errors', mode 'w' at 0xb6d99c28>,'wsgi.file_wrapper': <built-in function uwsgi_sendfile>,'wsgi.input': <uwsgi._Input object at 0x953e698>,'wsgi.multiprocess': True,'wsgi.multithread': False,'wsgi.run_once': False,'wsgi.url_scheme': 'http','wsgi.version': (1, 0)}>我已經(jīng)ALLOWED_HOSTS = ['.derekkwok.net'] 在settings.py文件中進(jìn)行了設(shè)置。這里發(fā)生了什么?有人假裝成為Google并訪問(wèn)我的網(wǎng)站嗎?還是有人錯(cuò)誤地設(shè)置了HTTP_HOST標(biāo)頭的情況?
查看完整描述

3 回答

?
小怪獸愛(ài)吃肉

TA貢獻(xiàn)1852條經(jīng)驗(yàn) 獲得超1個(gè)贊

如果您ALLOWED_HOSTS的設(shè)置正確,則可能有人通過(guò)欺騙標(biāo)頭來(lái)探測(cè)您的站點(diǎn)是否存在漏洞。


Django開(kāi)發(fā)人員正在討論將其從500內(nèi)部服務(wù)器錯(cuò)誤更改為400響應(yīng)。


查看完整回答
反對(duì) 回復(fù) 2019-11-27
  • 3 回答
  • 0 關(guān)注
  • 867 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)