Fixed bug in http code.

Change-Id: I3d7b3c4c7294eab9c0dfbb22cc65f77e235e5f74