我正在挂火狐的发送和WSARecv。发送应删除gzip标头(=> Accept-Encoding:none),WSARecv挂钩应编辑数据。
目前,WSARecv函数不会更改任何数据,只会将其打印出来以用于调试日志。许多网站都可以使用,但有时图片无法加载或页面没有加载。
我可以在bing.com的WSARecv函数答案中找到以下服务器响应(错误400错误请求):
Hooked Send
GET /fd/ls/l?IG=c5c4c27da26c4c5db3e1ed6adbfafc0d&TYPE=Event.ClientInst&DATA=%5B%7B%22T%22:%22CI.Init%22,%22FID%22:%22CI%22,%22Name%22:%22Base%22,%22TS%22:1253465714457%7D,%7B%22W%22%3A1670%2C%22H%22%3A701%2C%22T%22:%22CI.Dims%22,%22FID%22:%22HP%22,%22Name%22:%22br%22,%22TS%22:1253465714457%7D,%7B%22Data%22%3A-1%2C%22T%22:%22CI.Test%22,%22FID%22:%22HP%22,%22Name%22:%22IsLive%22,%22TS%22:1253465714457%7D,%7B%22Time%22%3A489%2C%22T%22:%22CI.Load%22,%22FID%22:%22HP%22,%22Name%22:%22bg%22,%22TS%22:1253465714946%7D%5D HTTP/1.1
00001138 3.75038576 [4024] Host: a4.bing.com
00001139 3.75038576 [4024] User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.3) Gecko/20090824 YFF35 Firefox/3.5.3 (.NET CLR 3.5.30729)
00001140 3.75038576 [4024] Accept: image/png,image/;q=0.8,/;q=0.5
00001141 3.75038576 [4024] Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
00001142 3.75038576 [4024] Accept-Encoding: none
00001143 3.75038576 [4024] Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7
00001144 3.75038576 [4024] Keep-Alive: 300
00001145 3.75038576 [4024] Connection: keep-alive
00001146 3.75038576 [4024] Referer: http://www.bing.com/
00001147 3.75038576 [4024] Cookie: MUID=D22A51BCBBD54DD3BE74682327101C0A; SRCHD=MS=904338&D=792606&AF=IE8SRC; SRCHUSR=AUTOREDIR=0&GEOVAR=&DOB=20090704; SRCHUID=V=2&GUID=2069ECD3092B453ABFCB9C4762409ACD; _HOP=; _FS=mkt=de-DE&ui=de-DE
(end of header)
Hooked WSARecv
00001152 4.03753757 [4024] HTTP/1.1 204 No Content
00001153 4.03753757 [4024] Cache-Control: private
00001154 4.03753757 [4024] Content-Length: 0
00001155 4.03753757 [4024] P3P: CP="NON UNI COM NAV STA LOC CURa DEVa PSAa PSDa OUR IND", policyref="http://privacy.msn.com/w3c/p3p.xml"
00001156 4.03753757 [4024] Date: Sun, 20 Sep 2009 16:55:17 GMT
00001157 4.03753757 [4024] Connection: keep-alive
00001158 4.03753757 [4024]
00001159 4.03753757 [4024] HTTP/1.0 400 Bad Request
00001160 4.03753757 [4024] Server: AkamaiGHost
00001161 4.03753757 [4024] Mime-Version: 1.0
00001162 4.03753757 [4024] Content-Type: text/html
00001163 4.03753757 [4024] Content-Length: 216
00001164 4.03753757 [4024] Expires: Sun, 20 Sep 2009 16:55:17 GMT
00001165 4.03753757 [4024] Date: Sun, 20 Sep 2009 16:55:17 GMT
00001166 4.03753757 [4024] Connection: close
00001167 4.03753757 [4024]
00001168 4.03753757 [4024]
00001169 4.03753757 [4024] Bad Request
00001170 4.03753757 [4024]
00001171 4.03753757 [4024]
Bad Request
00001172 4.03753757 [4024] Your browser sent a request that this server could not understand.
00001173 4.03753757 [4024] Reference #7.cea432c3.1253465717.0
00001174 4.03753757 [4024]
00001175 4.03753757 [4024]
我的问题是:我的HTTP标头出了什么问题?为什么有些页面会出现400错误。它是Accept-Encoding:none?
感谢阅读:)
答案 0 :(得分:2)
“none”不是“Accept-Encoding”标头的可接受值。并非所有服务器都会查看该标头,但那些服务器通常会在使用之前对其进行验证。要使服务器发送未压缩的数据,请完全省略标题,或将其设置为“identity”。