journey icon indicating copy to clipboard operation
journey copied to clipboard

Handle Buffers being passed back (even though journey is intended to be JSON only)

Open dhendo opened this issue 13 years ago • 0 comments

If a buffer is returned from a route, currently Journey will error on the line, as byteLength is expecting a string.

Buffer.byteLength(outcome.body);

Seeing as converting a Buffer to JSON is not a huge amount of use, my patch returns the buffer, and retains the Content-Type as is.

I know journey is supposed to be JSON-only, but the code change to support binary files is minimal and low impact.

dhendo avatar Dec 16 '11 17:12 dhendo