Friday, 15 April 2011

ruby on rails - Remove Http header response -



ruby on rails - Remove Http header response -

i working on project requires client create api phone call rails application , homecoming xml without http header info.

its returning:

http/1.1 200 ok cache-control: no-cache, no-store, max-age=0, must-revalidate pragma: no-cache expires: fri, 01 jan 1990 00:00:00 gmt content-type: application/xml; charset= x-ua-compatible: ie=edge x-request-id: c5602cd7eb23ca8137bef8bb1f0a4f8a x-runtime: 0.027900 server: webrick/1.3.1 (ruby/1.9.3/2013-11-22) date: wed, 18 jun 2014 05:27:48 gmt content-length: 529 connection: keep-alive set-cookie: _session_id=a8039d615674feec206e6c55a7a7afc8; path=/; httponly <?xml version="1.0" encoding="utf-8"?> <cxml> <response> <status code="200" text="ok"/> <startpage> <url>http://localhost:3000/foobar/bah7ddonymfza2v0awrji... </startpage> </response> </cxml>

can help remove http headers within controller or config? below section.

http/1.1 200 ok cache-control: no-cache, no-store, max-age=0, must-revalidate pragma: no-cache expires: fri, 01 jan 1990 00:00:00 gmt content-type: application/xml; charset= x-ua-compatible: ie=edge x-request-id: c5602cd7eb23ca8137bef8bb1f0a4f8a x-runtime: 0.027900 server: webrick/1.3.1 (ruby/1.9.3/2013-11-22) date: wed, 18 jun 2014 05:27:48 gmt content-length: 529 connection: keep-alive set-cookie: _session_id=a8039d615674feec206e6c55a7a7afc8; path=/; httponly

i using nginx @ moment.

i have says kind of nonsense request, since http servers definition uses header talk 1 another. have been informed w3 think otherwise.

http://www.w3.org/protocols/rfc2616/rfc2616-sec4.html#sec4

i have googled around hours attempting other solutions changing rails controller without success. lastly resort perchance changing config in nginx , wouldn't effect whole rails application , not api calls or there way single out 1 call?

thanks in advance.

t

this nonsense request, yeah. can utilize httpheadersmore module remove of response headers. should it:

location /your/api/path { more_clear_headers '*'; }

however, can't remove connections header without patching nginx. , if could, can't remove first line of response ("http/1.1 200 ok", in case). without line, isn't http response. you're going have hard time convincing http server send non-http responses.

to you're describing, think you'll need custom server communicates on bare tcp sockets. this tutorial might help out. or maybe implement part of app in node.js (or tool)?

ruby-on-rails nginx http-headers xmlhttprequest httpresponse

No comments:

Post a Comment