At 15:49 27/2/2002 -0800, you wrote:
>"Eduardo M. Cavalcanti" <[EMAIL PROTECTED]> writes:
>
> > If one try to set a header like this:
> > $the_request->headers->header(REMOTE_ADDR=>'234.234.234.234');
>
>Why do you want to do this?  Fool some CGI script?

We deal with content clipping and we are integrating our software into a 
client�s system.  The part of their system we are dealing with in this case 
expects requests from the connected user, not from our software, that is 
running in his name.
We are trying not to force a modification on the client�s system.


> > A header REMOTE-ADDR is created. The underscore is substituted with an 
> hifen.
> >
> > Setting $HTTP::Headers::TRANSLATE_UNDERSCORE = 0 solves the problem,
> > but if the HTTP::Header object has already been created the assignment
> > does not have effect and the problem remains. So the following results
> > in a REMOTE-ADDR header (with undesired hifen).
> >
> > $save_translate = $HTTP::Headers::TRANSLATE_UNDERSCORE;
> > $HTTP::Headers::TRANSLATE_UNDERSCORE = 0;
> > $the_request->headers->header(REMOTE_ADDR=>'234.234.234.234');
> > $HTTP::Headers::TRANSLATE_UNDERSCORE = $save_translate;
>
>local is your fried:
>
>{
>    local $HTTP::Headers::TRANSLATE_UNDERSCORE = 0;
>    $the_request->headers->header(REMOTE_ADDR=>'234.234.234.234');
>}

I have just tried it but does not work.


> > Setting $HTTP::Headers::TRANSLATE_UNDERSCORE before creating request
> > objects solves the problem but causes collateral effects since libwww
> > counts on the underscore translation to operate correctly. (A
> > Content-Type header would be created as Content_Type)
>
>Those cases where LWP itself use '_'-header-names should be fixed.

There�s a case when I have to POST a multipart form and the resulting 
Content-Type header is:

Content-Type = application/x-www-form-urlencoded
Content_Type = multipart/form-data


> > Direct manipulation of an HTTP::Header object is not feasible because
> > there are scoped lexicals used in the internal representation of a
> > header (my $standard_case).
>
>I did not understand this.

Just trying to set the header accessing the HTTP::Header data structure 
directly, bypassing the header method.

Thanks for your help.
Eduardo

Reply via email to