HEADER (Dedicated)

The HEADER element defines a custom header in an application configuration file that is dedicated to a specific application or service.

Syntax

<HEADER Name="header-name">header-value</HEADER>
  1. header-name defines the unique identifier for the HTTP header.
  2. header-value is a value for the header.

Child elements

There are no child elements.

Usage

Use this element to define HTTP headers in configuration files for applications and services. Its is only valid in external application configuration files, not in the GAS configuration file (as.xcf).

You can configure several HEADER elements to define custom headers that apply to a specific application or service. These headers are always sent in the HTTP response. The GAS sends these in addition to headers defined for all applications in the HEADER element of the GAS configuration file. If the same HEADER element is set in both the application configuration file and the GAS configuration file, the HEADER defined in the application configuration file is used; the GAS configuration file is ignored.

Limitations

The headers defined in HEADER elements of an application configuration file are not sent in the response of URLs for public resources, such as images (/ua/i) and reports (/ua/report/). As these are public URLs, the HEADER defined for individual applications or services cannot be applied; only the common HEADER defined in the GAS configuration file will apply.

The following examples outline how to configure the custom HTTP headers sent in HTTP responses for your application or service.

Example: Application configuration file with custom headers

<?xml version="1.0" encoding="UTF-8" ?>
<APPLICATION Parent="defaultgwc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/5.00/cfextwa.xsd">
  <EXECUTION AllowUnsafeSession="TRUE">
    <PATH>$(res.deployment.path)</PATH>
    <MODULE>myapp</MODULE>
  </EXECUTION>
  <HTTP>
    <HEADER Name="Header_1">Hello</HEADER>
    <HEADER Name="Header_2">World</HEADER>
    <HEADER Name="Header_3">How</HEADER>
    <HEADER Name="Header_4">Are</HEADER>
    <HEADER Name="Header_5">You</HEADER>
  </HTTP>
</APPLICATION>

Example: web service configuration file with custom headers

<?xml version="1.0" encoding="UTF-8" ?>
<APPLICATION Parent="ws.default" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/5.00/cfextwa.xsd">
  <EXECUTION>
    <ENVIRONMENT_VARIABLE Id="FGLWSDEBUG">0</ENVIRONMENT_VARIABLE>
    <PATH>$(res.deployment.path)</PATH>
    <MODULE>myservice</MODULE>
  </EXECUTION>
  <HTTP>
    <HEADER Name="Header_1">Hello</HEADER>
    <HEADER Name="Header_2">World</HEADER>
    <HEADER Name="Header_3">How</HEADER>
    <HEADER Name="Header_4">Are</HEADER>
    <HEADER Name="Header_5">You</HEADER>
  </HTTP>
</APPLICATION>

Parent elements

This element is a child of the HTTP (Dedicated) element.