You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Adam Ambrose <ad...@access-us-inc.com> on 2003/07/22 20:33:33 UTC

Re: WebResponse.getHeaderField() no longer contains inserted headers

There's a known bug in 1.4.1 about a very similar issue.  Unfortunately,
it is marked as "fixed" for version 1.4.1 in bugzilla, which is not
technically true, since it was fixed in 1.5:
http://issues.apache.org/bugzilla/show_bug.cgi?id=16475

What happens if you add 3 or more headers?   I found that adding some
extra dummy headers caused the header I wanted to be passed to the
client.

-- 
Adam Ambrose <ad...@access-us-inc.com>
Access Systems America, Inc.


On Mon, 2003-07-21 at 21:49, David M. Karr wrote:
> >>>>> "David" == David M Karr <dm...@earthlink.net> writes:
> 
>     David> In the past, I've built Cactus tests where I call
>     David> "HttpServletResponse.addHeader()" in my "test..." method, in order to
>     David> communicate to my "end..." method some information I need to check for (since
>     David> there's no other practical way for the "test..." method to communicate to the
>     David> "end..." method).  In my "end..." method, I use "WebResponse.getHeaderField()"
>     David> to retrieve the header with an agreed-upon key.
> 
>     David> This was working with Cactus 1.3.
> 
>     David> I've now updated to 1.5beta1 (because this appears to be the "current"
>     David> release).  My tests are now failing because the call to
>     David> "WebResponse.getHeaderField()" is not finding the header.  Just to check, I
>     David> tried looping through the result of "WebResponse.getHeaderFieldNames()", and I
>     David> find that it does have some headers, just not the one I inserted on the
>     David> "client" side.
> 
>     David> Has this machinery changed such that I have to do this differently, or is this
>     David> just a bug in the beta release?
> 
> I've now tried backing up to Cactus 1.4.1, with the same result.  I don't
> understand what I could be doing wrong.



Re: WebResponse.getHeaderField() no longer contains inserted headers

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Adam" == Adam Ambrose <ad...@access-us-inc.com> writes:

    Adam> There's a known bug in 1.4.1 about a very similar issue.  Unfortunately,
    Adam> it is marked as "fixed" for version 1.4.1 in bugzilla, which is not
    Adam> technically true, since it was fixed in 1.5:
    Adam> http://issues.apache.org/bugzilla/show_bug.cgi?id=16475

    Adam> What happens if you add 3 or more headers?   I found that adding some
    Adam> extra dummy headers caused the header I wanted to be passed to the
    Adam> client.

Sigh.  Yes, after adding a handful of dummy headers, the header I need managed
to sneak through.  After getting past that test, I got through numerous other
test cases that use the same technique (passing values through headers),
without a single error.  Weird.  I'm not going to commit code like this, but at
least I can continue testing.

I had earlier tried to upgrade to 1.5-beta1, but this caused the Ant interface
to break for some reason.  The build always failed with:

"taskdef class org.apache.cactus.ant.RunServerTestsTask cannot be found".

At least when I backed up to 1.4.1, this problem went away.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP; SCWCD




RE: WebResponse.getHeaderField() no longer contains insertedheaders

Posted by Adam Ambrose <ad...@access-us-inc.com>.
On Sun, 2003-08-10 at 06:15, Vincent Massol wrote:
> Hi David/Adam,
> 
> Adam, one comment: The version information in bugzilla is not the
> version where the bug was fixed but rather the version in which the bug
> was reported.

That explains my confusion.  Where I work, we update the Bugzilla
Version field to reflect the version in which the bug needs to be (and
is) fixed.

-Adam


RE: WebResponse.getHeaderField() no longer contains insertedheaders

Posted by Vincent Massol <vm...@pivolis.com>.
Hi David/Adam,

Adam, one comment: The version information in bugzilla is not the
version where the bug was fixed but rather the version in which the bug
was reported.

I am not aware of any bug related to headers ATM. There is one test in
Cactus about response headers:

    public void testResponseAddHeaders()
    {
        response.addHeader("X-Test-Header1", "value1");
        response.addHeader("X-Test-Header2", "value2");
    }

    public void endResponseAddHeaders(WebResponse theResponse) 
    {
        String value1 = 
 
theResponse.getConnection().getHeaderField("X-Test-Header1");
        String value2 = 
 
theResponse.getConnection().getHeaderField("X-Test-Header2");

        assertEquals("value1", value1);
        assertEquals("value2", value2);
    }

David, can you verify it works for you too?

Would you be able to provide a simple test that proves the problem
you're having so that I can run it here?

Thanks
-Vincent

> -----Original Message-----
> From: Adam Ambrose [mailto:adam_ambrose@access-us-inc.com]
> Sent: 22 July 2003 20:34
> To: Cactus Users List
> Subject: Re: WebResponse.getHeaderField() no longer contains
> insertedheaders
> 
> There's a known bug in 1.4.1 about a very similar issue.
Unfortunately,
> it is marked as "fixed" for version 1.4.1 in bugzilla, which is not
> technically true, since it was fixed in 1.5:
> http://issues.apache.org/bugzilla/show_bug.cgi?id=16475
> 
> What happens if you add 3 or more headers?   I found that adding some
> extra dummy headers caused the header I wanted to be passed to the
> client.
> 
> --
> Adam Ambrose <ad...@access-us-inc.com>
> Access Systems America, Inc.
> 
> 
> On Mon, 2003-07-21 at 21:49, David M. Karr wrote:
> > >>>>> "David" == David M Karr <dm...@earthlink.net> writes:
> >
> >     David> In the past, I've built Cactus tests where I call
> >     David> "HttpServletResponse.addHeader()" in my "test..." method,
in
> order to
> >     David> communicate to my "end..." method some information I need
to
> check for (since
> >     David> there's no other practical way for the "test..." method
to
> communicate to the
> >     David> "end..." method).  In my "end..." method, I use
> "WebResponse.getHeaderField()"
> >     David> to retrieve the header with an agreed-upon key.
> >
> >     David> This was working with Cactus 1.3.
> >
> >     David> I've now updated to 1.5beta1 (because this appears to be
the
> "current"
> >     David> release).  My tests are now failing because the call to
> >     David> "WebResponse.getHeaderField()" is not finding the header.
> Just to check, I
> >     David> tried looping through the result of
> "WebResponse.getHeaderFieldNames()", and I
> >     David> find that it does have some headers, just not the one I
> inserted on the
> >     David> "client" side.
> >
> >     David> Has this machinery changed such that I have to do this
> differently, or is this
> >     David> just a bug in the beta release?
> >
> > I've now tried backing up to Cactus 1.4.1, with the same result.  I
> don't
> > understand what I could be doing wrong.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org