-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incidental output (to *out*
) during JSON streaming can produce invalid JSON
#495
Comments
Hi @ordnungswidrig -- thanks for reporting the issue!
Is there a reason why you're explicit calling |
Thanks for pointing out, better to use the interceptor. Nevertheless the behaviour of |
I agree we should document this split (utility functions vs interceptors) better and explain the use case within the doc strings. Leaving this issue open to address that. Thanks @ordnungswidrig |
Documentation, explicitly marking things as deprecated, and actual removal would be an improvement. |
I've fixed the buggy part (random output mixed into the JSON stream) here: 39cc924 |
*out*
) during JSON streaming can produce invalid JSON
Description
Output written to stdout, e.g. debug logging can accidently land in the json response create with
io.pedestal.http/json-response
.Expected Behavior
If a lazy sequence generates output to stdout during realization and is used as a value in a json response, the output to stdout is actually written to the http response outputstream because
*out*
is rebound during the execution ofjson-response
.Actual Behavior
*out*
should never be rebound without explicit notice to the user.Steps to reproduce
Response body is like this:
Environment
Arachne on pedestal via
[org.arachne-framework/pedestal-assets "0.1.0-master-0006-46abdf0"]
Operating System (including version).
Darwin monoid.h.c6e.de 16.3.0 Darwin Kernel Version 16.3.0: Sun Oct 23 14:50:01 PDT 2016; root:xnu-3789.30.76~4/RELEASE_X86_64 x86_64
Your current Leiningen version (
lein --version
)Pedestal version
0.5.2
The text was updated successfully, but these errors were encountered: