spray/spray — pull request #411 by agemooij (2013-07-31 22:32:32+00:00)
Title: + routing: add some more high-level encoding/decoding directives (fixes #149)

This is a first draft to fix #149, please comment on this approach.

I added two new encoding directives: withGzipSupport and withOptionalGzipSupport, where the latter doesn't force Gzip encoding if no specific encoding is requested. I had a hard time thinking up proper names for these directives. I'm open to better suggestions :)

I found that the hardcoded "helloGzipped" value used in the unit tests did not actually match the output of gzipping "Hello" so I replaced it with the actual output of the GzipCompressor.

I also added some extra tests for the decodeRequest(X) | decodeRequest(Y) compound directive

Open questions:
- are these the right names for the two new directives? I found it hard to come up with better ones.
- Should similar directives be added for Deflate?
- are there enough tests?

Let me know what you think.
Age