Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Typo in Facebook's HTTP header "X-Cnection: close" intentional? (imgur.com)
9 points by gary4gar on Jan 8, 2012 | hide | past | favorite | 4 comments



in the link says

"FYI, the reason it misspells the word connection is so that the internet check-sum (a simple sum) still adds up, this way the change can occur at the packet level. If it completely removed the header, it would have to stall forwarding the response until the header was entirely read, so it could rewrite the headers, recompute the checksum and then send it along."

Wow, I am impressed. it is really a clever hack! Thanks for the link :)


You're welcome. However, the checksum doesn't work out for "X-Cnection":

  >>> sum(ord(c) for c in "Connection")
  1040
  >>> sum(ord(c) for c in "X-Cnection")
  952
I suspect that in this specific scenario the checksum doesn't need to stay the same, but the packet size does.


That is pretty neat, I've noticed this before and like the OP just assumed it was a typo, nice to see the explanation. No matter how much you think you know, you don't know everything, that's what makes the IT field so interesting




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: