Skip to content

Loading…

HTTP streaming is on = no json content #1337

Closed
andriytyurnikov opened this Issue · 0 comments

2 participants

@andriytyurnikov

#when
#in SomeController
stream

def some_action
respond_to do |format|
format.json do
render :json => @some_collection.map{ |p| { id: p.id, name: p.full_name} }
end
end
end

#request and respose headers looks same, but no JSON content is visible in browser

#Perhaps it is misuse or something, but it should be documented or reimplemented defensively then, IMHO

@josevalim josevalim added a commit that closed this issue
@josevalim josevalim Remove stream at the class level.
This is because only template rendering works with streaming.
Setting it at the class level was also changing the behavior
of JSON and XML responses, closes #1337.
7da88c5
@josevalim josevalim closed this in 7da88c5
@jhtwong jhtwong pushed a commit to SAP-Oxygen/rails that referenced this issue
@josevalim josevalim Deprecate stream at the class level.
This is because only template rendering works with streaming.
Setting it at the class level was also changing the behavior
of JSON and XML responses, closes #1337.
a05d59f
@ttosch ttosch pushed a commit that referenced this issue
@josevalim josevalim Deprecate stream at the class level.
This is because only template rendering works with streaming.
Setting it at the class level was also changing the behavior
of JSON and XML responses, closes #1337.
c8997d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.