On Fri, 28 Mar 2014, Ludo Brands wrote:

On 03/27/2014 10:57 PM, Michael Van Canneyt wrote:


On Thu, 27 Mar 2014, Leonardo M. Ramé wrote:

Hi, I'm sending a custom header I called "Filename" to a Brook CGI
(which uses TRequest from fcl-web) but I can't access that header.

To my knowledge, the CGI protocol doesn't support the use of custom
headers.


AFAIK, the CGI protocol doesn't specify anything regarding custom
headers. It only specifies mandatory variables but leaves custom headers
to the webserver implementation. Apache forwards most headers in
environment variables (http://httpd.apache.org/docs/trunk/env.html).
But, CustCgi only reads a set of known variables listed in CgiVarNames.

Can you try

HTTPDecode(GetEnvironmentVariable('Filename'));

to get your custom header?

A good practice is to start your custom headers with 'X-YourAPP-'.
Headers starting with 'X-' are in a lot of implementations considered as
application specific headers and not touched by transport agents.

If this is indeed the case, then I will add a GetCustomHeader to the TRequest.
TResponse has SetCustomHeader() so this is nicely symmetric.

Michael.
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to