Goliath not sending headers when streaming

23 views
Skip to first unread message

James

unread,
May 14, 2015, 7:24:05 PM5/14/15
to golia...@googlegroups.com
Hi,

I'm using Grape with Goliath (latest versions). For some reason the headers are not getting sent (in the response) using streaming_response or the array syntax::

 def response(env)
    My::API.call(env)
    streaming_response(200, { 'Content-Type' =>'application/json', 'X-Stream' => 'Goliath' } )
  end

I can see debugging the code inside goliath/request.rb that  @response.headers has indeed the headers and they are also set correctly in the headers_output method in goliath/response.rb

However, when I use curl -i -X GET "url" I only see the JSON output that I'm returning (no headers). Same behaviour using  a web browser.

It does return the headers fine when I'm not using streaming (Goliath::Response::STREAMING).

Any ideas about what can be wrong?

James

unread,
May 15, 2015, 4:44:43 PM5/15/15
to golia...@googlegroups.com
I might be wrong but it looks like it's using a websocket? I can see the @conn.send_data ends up in websocket.send_data....

But actually what I want to do is a long polling HTTP server. Does anyone know if this is possible at all or what am I doing wrong / missing here?
Reply all
Reply to author
Forward
0 new messages