- From: Benoit Mahe <Benoit.Mahe@sophia.inria.fr>
- Date: Wed, 10 Sep 1997 09:59:28 +0200
- To: Payam Mirrashidi <payam@netmosphere.com>
- cc: www-jigsaw@w3.org, bmahe@www43.inria.fr
> I'm having a strange problem with JigsawHttpServletResponse setHeader() method. > For some reason, its not working for me in a very obvious case. I can't > seem to do a setHeader for "Set-Cookie". The result of the following class is: > "Set-Cookie=false". Am I going about this wrong? Making wrong assumptions > about what I can and can not set? This works with srun and I'm trying to figure > out what behaviour I'm depending on so that it doesn't work with jigsaw. > > I traced through the code that does this and noticed that the lower level > implementation > does a toLowerCase() on the keys being added. Could this be the cause of the > problem? > > > > > import java.io.*; > import javax.servlet.*; > import javax.servlet.http.*; > > public class tester extends HttpServlet { > protected void doGet (HttpServletRequest req, HttpServletResponse res) > throws ServletException, IOException > { > res.setContentType("text/html"); > res.setHeader("Set-Cookie","TONE=BASS"); > boolean contains = res.containsHeader("Set-Cookie"); > > res.getOutputStream().print("<HTML><BODY>Set-Cookie="+contains+"</BODY></HTML>"); > > } > } > I think it's a bug in the containsHeader method of JigsawHttpServletResponse. public boolean containsHeader(String header) { return request.hasHeader(header); } must be public boolean containsHeader(String header) { return reply.hasHeader(header); } The Set-Cookie Header is set correctly (in reply) but the containsHeader method look at the request object. - Benoît Mahé ------------------------------------------------------- World Wide Web Consortium bmahe@sophia.inria.fr Architecture domain - Jigsaw Team tel : 04 93 65 79 89 ---------------------------------------------------------------------
Received on Wednesday, 10 September 1997 04:00:53 UTC