binary.toByteString() correctly checks if the argument is a Binary instance (which is true for ByteArray instances), but then calls toByteString() with source and target charsets. This creates a String based on the ByteArray using the source charset (default: utf-8), and a new Binary instance using the target charset (utf-8).
The effect is that stick's etag middleware (which uses binary.toByteString()) breaks responses consisting of ByteArrays, but works fine if the charset arguments in binary.toByteString() are removed.
Possible solutions: either re-apply the check introduced in 8edcb927846a in etag middleware, or remove the charset arguments here - but i'm not sure if the latter would be safe to do
binary.toByteString() correctly checks if the argument is a Binary instance (which is true for ByteArray instances), but then calls toByteString() with source and target charsets. This creates a String based on the ByteArray using the source charset (default: utf-8), and a new Binary instance using the target charset (utf-8).
The effect is that stick's etag middleware (which uses binary.toByteString()) breaks responses consisting of ByteArrays, but works fine if the charset arguments in binary.toByteString() are removed.
Possible solutions: either re-apply the check introduced in 8edcb927846a in etag middleware, or remove the charset arguments here - but i'm not sure if the latter would be safe to do