Follow up on r49157 and r50902. Fixed the header parsing code to conform to RFC.