我試圖做HEAD請求按照302頁的鏈接,但此鏈接:http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNGrJk-F7Dmshmtze2yhifxRsv8sRg&url=http://www.mtv.com/news/articles/1647243/20100907/story.jhtml有沒有辦法讓GET請求沒有得到內容的正文?
是麻煩,因爲一個HEAD請求返回一個200 OK和一個GET請求返回預期的302狀態碼。
所以我需要做一個GET請求,但我寧願不必爲獲取整個HTML文檔而來的額外帶寬時間付費。任何人都知道在沒有得到身體返回的情況下進行GET的攻擊?
UPDATE:便將大衛建議做一個Range頭,但他們似乎仍然可以忽略它
GET /news/url?sa=t&fd=R&usg=AFQjCNGrJk-F7Dmshmtze2yhifxRsv8sRg&url=http://www.mtv.com/news/articles/1647243/20100907/story.jhtml HTTP/1.1
Range: bytes=0-10
x-ms-range: 0-600
Host: news.google.com
Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
HTTP/1.1 302 Moved Temporarily
Content-Type: text/html; charset=UTF-8
Location: http://www.mtv.com/news/articles/1647243/20100907/story.jhtml
Content-Length: 258
Date: Wed, 08 Sep 2010 20:28:16 GMT
Expires: Wed, 08 Sep 2010 20:28:16 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Set-Cookie: PREF=ID=ef5f1bc768645c5e:TM=1283977696:LM=1283977696:S=5n26IrEDpcQTJIb1; expires=Fri, 07-Sep-2012 20:28:16 GMT; path=/; domain=.google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.mtv.com/news/articles/1647243/20100907/story.jhtml">here</A>.
</BODY></HTML>
它看起來像Web服務器(在這種情況下,Google新聞)設置爲在發出HEAD請求時發回200狀態代碼。這不是標準實現,HEAD請求也應該返回302狀態碼。由於這是一個錯誤,所以我沒有看到有什麼可以做的。 – Asaf 2010-09-08 20:20:07