This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Is an empty body with a non-zero Content-Length header valid for a HTTP HEAD request?

0

I encountered a pcap file involving HTTP HEAD request. The response (packet 6) has a HTTP header Content-Length being 163 but there is no body. Packet 7 is another request. Wonder if this is a valid HTTP transaction.

File: https://www.cloudshark.org/captures/f5349e67266c

Thanks.

asked 13 Jul '15, 07:24

pktUser1001's gravatar image

pktUser1001
201495054
accept rate: 12%

edited 14 Jul '15, 05:52

Lekensteyn's gravatar image

Lekensteyn
2.2k3724


One Answer:

1

Yes, it is. This HTTP feature is intended for just that, getting URL meta information (like its size) from the source without actually getting the object. It would defeat its purpose if the Content-Length would be 0 then.

See also here.

answered 13 Jul '15, 22:10

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

Thanks @jaap! It makes sense.

(20 Jul '15, 10:50) pktUser1001