実際にブラウザがサーバにどのような要求メッセージを送っているのか確認してみた。
GET / HTTP/1.1
Host: bookmarklet.daa.jp
Connection: close
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7
Cache-Control: no
Accept-Language: de,en;q=0.7,en-us;q=0.3
Referer:http://web-sniffer.net/
Host: bookmarklet.daa.jp
Connection: close
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7
Cache-Control: no
Accept-Language: de,en;q=0.7,en-us;q=0.3
Referer:http://web-sniffer.net/
これに対してサーバから送られてきたメッセージはこうだ。
Date: Sat, 07 Mar 2009 02:51:59 GMT
Server: Apache
Last-Modified: Sat, 07 Mar 2009 02:50:05 GMT
ETag: "24c90d-92a8-49b1e0dd"
Accept-Ranges: bytes
Content-Length: 37544
Connection: close
Content-Type: text/html
Server: Apache
Last-Modified: Sat, 07 Mar 2009 02:50:05 GMT
ETag: "24c90d-92a8-49b1e0dd"
Accept-Ranges: bytes
Content-Length: 37544
Connection: close
Content-Type: text/html
ちなみに自分のサイトを見たケースである。
前回の記事でHTTP1.1では要求メッセージのヘッダにHost:フィールドが含まれなければいけないと記述した。要求メッセージの文を確認してみると、ちゃんとHost:フィールドが含まれていることが確認できた。