Passing in buffer data to http parser

adding test

getting rid of unncessary cast