net/http fixed

I got errors like https://gist.github.com/sonots/8921291, but this patch fixes it.