You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by James Bates <Ja...@amplexor.com> on 2005/05/10 13:07:21 UTC
User-Agent in Command-line interface
The Cocoon command line interface provides a switch for simulating the
Cocoon User-Agent header that would be sent by a browser. The idea being
that it could be used by e.g. the browser selector to "detect" that a
request is coming from the CLI.
When investigating however, I noticed that the Cocoon bean (the class
that implements the CLI) does not place the User-Agent into a HEDAER,
but into a request PARAMETER instead (occurs on line 407 of
CocoonWrapper.java, in method processURI() in BRANCH_2_1_X; line 421 of
the same file in 2.2 trunk).
Is there a particular reason for this behaviour? Would it be desirable
to change the behaviour so the User-Agent is indeed submitted as a
request HEADER, thus perfectly emulating a HTTP call? I am perfectly
willing to submit a patch to that effect...
Thanks,
James Bates
Re: User-Agent in Command-line interface
Posted by Upayavira <uv...@odoko.co.uk>.
James Bates wrote:
> The Cocoon command line interface provides a switch for simulating the
> Cocoon User-Agent header that would be sent by a browser. The idea being
> that it could be used by e.g. the browser selector to “detect” that a
> request is coming from the CLI.
>
>
>
> When investigating however, I noticed that the Cocoon bean (the class
> that implements the CLI) does not place the User-Agent into a HEDAER,
> but into a request PARAMETER instead (occurs on line 407 of
> CocoonWrapper.java, in method processURI() in BRANCH_2_1_X; line 421 of
> the same file in 2.2 trunk).
>
>
>
> Is there a particular reason for this behaviour? Would it be desirable
> to change the behaviour so the User-Agent is indeed submitted as a
> request HEADER, thus perfectly emulating a HTTP call? I am perfectly
> willing to submit a patch to that effect...
The CLI/bean should work exactly the same as a browser. I have seen that
on occasions and wondered about it.
What you are saying makes sense, and I'd happily commit a patch of yours.
Regards, Upayavira