The offending part is the "*; q=.2" entry. A single star is not allowed according to my interpretation of the spec. It should be "*/*" (as the final entry of the Accept header shows it). However, I'm sure there is a reason why the developers of scala.io.Source put in that entry, I just don't see it yet.
Anybody have any idea, why spray should also allow this actually malformed variant?
Cheers,
Mathias
---
mat...@spray.cc
http://www.spray.cc
The culprit is the Sun-specific implementation of the abstract java.net.HttpURLConnection class (sun.net.www.protocol.http.HttpURLConnection). It defines the offending content of the Accept header as a static field. All code using java.net.HttpURLConnection on a Sun JVM (directly or indirectly, like scala.io.Source) has this problem.
We still don't know, why Sun put in that particular irregular header, but actually it doesn't really matter.
Since we definitely want to allow users to talk to spray servers using the standard Java HTTP client we will relax the Accept header constrains to allow the single star notation as well. I just added a respective issue (https://github.com/spray/spray/issues/12)
Cheers,
Mathias
---
mat...@spray.cc
http://www.spray.cc