Fixed undefined behaviour when using HttpExtensions

#HOST-16 fixed