Quoting Thilo Planz <suppressed>:
> > header_add - add a header of this type to the current list
>
> I think adding "a header of this type to the current list" makes sense
> only for cookies.
> Passing a list (arrayref) to CGI->header does not work with other
> headers than cookies:
>
> > CGI::header(-expires => [1,2], -cookie => [1,2]);
>
> results in
>
> > Set-Cookie: 1 <=== array ref working (two cookie headers)
> > Set-Cookie: 2
> > Expires: ARRAY(0x1a264a0) <=== array ref not working
> > Date: Sun, 09 Nov 2003 12:54:25 GMT
> > Content-Type: text/html; charset=ISO-8859-1
But notice that CGI.pm doesn't die when you do this. It just does what the user
has asked. I don't think we should build in a whole bunch of functionality into
CGI::App to check the validity of the headers that they are sending in.
I think CGI::App should just have a fairly transparent interface to the CGI.pm
header functionality. we are still depending on the user to use the correct
CGI.pm syntax (ie using -cookie to set a Set-Cookie header, and -type to set a
Content-type header). So why should we bother doing checks on the parameters
when that is really the job of CGI.pm.
I think it will be sufficient to clearly define what header_add and header_set
do, and explain that header_add should be used when setting cookies so as not to
clobber any existing cookies that may have been set, and all other headers
should use header_set.
Cheers,
Cees
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.