fix content-length

Previous implementation send characters and not bytes as it should.