Custom HTTP header



I want a simple http header like the one below.

HTTP/1.1 200 OK
Server: Mongrel 1.1.5
Set-Cookie: JSESSIONID=<session_key>; Path=/
Content-Type: text/html;charset=UTF-8
Content-Length: 138
Date: Fri, 15 May 2009 01:48:42 GMT
Connection: close


I'm using rails 2.2.2. I can't override the set-cookie part and I also
want to remove the ETag and X-Runtime parts. I was able to remove the
Status and Cache-Control parts by using the delete method.

I tried using

cookies['JSESSIONID'] = <sessions_key>

but the my_session cookie is still there.


HTTP/1.1 200 OK
Connection: close
Date: Tue, 19 May 2009 02:45:20 GMT
Set-Cookie: _my_session=<session_key>; path=/; HttpOnly
ETag: "100098631aaee632fb77079e8a6c4932"
X-Runtime: 260ms
Content-Type: text/html; charset=utf-8
Content-Length: 137
Server: Mongrel 1.1.5


I got the headers above from wireshark. The first header is generated
by connecting to a java server.


thanks!
--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: minimal httpd response
    ... RST, abortively closing the connection. ... The responsibilities of an HTTP/1.1 proxy, and of an HTTP/1.1 server ... user agent, without a proxy, first, and then try to deal ... Connection header; with a Content-length header; or with the chunked ...
    (comp.programming)
  • Re: Which server component?
    ... it into an SSL server. ... passenger which enables the ssl security and the persistent connection. ... back to the client. ... balancer using mod_proxy_balancer in conjunction with several Mongrel ...
    (comp.lang.ruby)
  • Re: How come this doesnt work?
    ... Specify the correct Content-Type for it ... Use the "Connection: Keep-Alive" header to be able to do multiple HTTP-Requests on the same connection. ... Supply a correct Content-Length header, so the server knows where the next request starts. ...
    (comp.lang.ruby)
  • Re: What is this code waiting for?
    ... and the web server is sat waiting for another request. ... the server times out the connection - and your read method returns ... open by default for further requests. ... If you send that header then the server ...
    (comp.lang.java.help)
  • Re: linux socket programming and HTTP Protocol Problem
    ... Why are you sending an *empty* content length header? ... Both web browsers connect to the server but both fail ... closing the connection before they've even *sent* their query. ...
    (comp.os.linux.development.apps)