The com.sun.net.httpserver does not conform to spec: http://tools.ietf.org/html/rfc7230#section-3.1.2 ( for some response codes, there is a missing trailing space in the status line ). Review thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-January/030843.html