PreviousNextIndex
Good Technology

Header Management

Good Intranet Server receives HTTP requests from a handheld and forwards them to their destination Internet hosts. Header management makes it possible for you to configure Good Intranet Server so that when it receives a handheld request intended for designated hosts it adds or modifies one or more HTTP headers in the request.

Header management settings are useful for accessing sites that are not configured to recognize Good Intranet (or other types of wireless) handhelds.

For example, the handheld might send Good Intranet as its user agent, but Good Intranet is not recognized by Hotmail. You can specify that the User-Agent header in all HTTP requests sent to hotmail.com is to be set to Mozilla/4.0, instead of Good Intranet.

You can use the default header-management property settings in the config.props file to change the User-Agent.

As a second example, you can add an email address header to all HTTP requests and set the header value to the email address of the handheld sending a request. When a web server receives a request it can then use the handheld email address for billing or other purposes. Inserting a header for email addresses is provided through the default header-management property settings in the config.props file.

You specify headers, header values, and the hosts that receive them by associating each of these with a header rule. A header rule is defined through three properties:

In each of these properties, rule_name is replaced by the name assigned to the header rule. For example, in the default header properties, there is a header rule for assigning an email address header to all HTML requests. The rule name is email and correspondingly there are three email properties:

header.rule_name.header.

This property specifies the name of the header to be inserted in an HTTP request or, if the header is already present, to be modified.

Example 1:

header.mozilla_ua.header User-Agent

In this example, the rule name is mozilla_ua and the rule is set to apply to the User-Agent header.

Example 2:

header.email.header GI_EMAIL

In this example, the rule name is email and the rule is set to apply to a GI_EMAIL header. Since GI_EMAIL is not a standard HTTP header, Good Intranet Server will insert this header into requests.

header.rule_name.value

This property specifies the value to be assigned to the header. The value is treated as a string and accepts variables representing either the value of a header (%header_name%) or the value of a handheld making a request.

Example 1:

header.email.header GI_EMAIL
header.email.value %gi_emailaddress%

In this example, the email rule specifies that a GI_EMAIL header is to be inserted in HTTP requests and that the value assigned to the header is to be the email address of the requesting handheld.

Example 2:

header.html_first.header Accept
header.html_first.value text/html, %Accept%

In this example, the rule html_first assigns the Accept header the literal value text/html, followed by the received value of the Accept header. For example, if the Accept header in the request received from the handheld is:

Accept: text/vnd.wap.wml, text/plain, text/html

Good Intranet Server modifies the header to appear as:

Accept: text/html, text/vnd.wap.wml, text/plain, text/html

The modified header ensures that a web server always sees text/html as the first element in the header.

Example 3:

header.mozilla_ua.header User-Agent
header.mozilla_ua.value Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; %User-Agent%)

In this example, the rule mozilla_ua sets the User-Agent header to the literal value Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; followed by the received value of the User-Agent header, followed by a close-parenthesis. For example, if the value of the User-Agent header sent by the handheld is:

Good Intranet 3.6.12 (PocketPC; Good Intranet; OS v. 4.4)

The header value sent to the destination web server is:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Good Intranet 3.6.12 (PocketPC; Good Intranet; OS v. 4.4))

This ensures that destination web servers view the handheld as compatible with Mozilla/4.0, even if they do not recognize the user-agent string for Good Intranet, which identifies the handheld's user agent.

header.rule_name.hosts

This property specifies the hosts that the rule applies to. If there are multiple hosts, enter them as a space-separated list.

At the beginning of a host name, you can use an asterisk (*) as a wildcard to represent one or more components of the name. The following are all acceptable:

Example
Description
header.rule1.hosts *
The rule applies to all hosts
header.rule2.hosts *.com
The rule applies to all .com hosts
header.rule3.hosts *.Good Intranet.com
The rule applies to all hosts that end with Good Intranet.com

You cannot use an asterisk (*) as a wildcard within a host name or as part of a component:

// The following are not valid uses of `*'
header.bad_rule1.hosts Good Intranet.*.com
header.bad_rule2.hosts *oogle.com

Default Header-Management Properties

The default header-management properties include:

Property Name
Default
Description
header.enable
false
If set to true, enables use of header management.
header.email.
header
GI_EMAIL
The header rule email applies to the header GI_EMAIL. Since GI_EMAIL is not a standard HTTP header, Good Intranet Server will insert this header in all HTTP requests sent to the hosts specified in header.email.hosts
header.email.
value
%gi_emailaddress%
The header rule email sets the value of the GI_EMAIL header to the email address of the handheld sending a request.
header.email.
hosts
*
The header rule email applies to HTTP requests sent to all hosts.
header.esn.
header
GI_ESN
The header rule esn applies to the header GI_ESN. Since GI_ESN is not a standard HTTP header, Good Intranet Server will insert this header in all HTTP requests sent to the hosts specified in header.esn.hosts
header.esn.
value
%gi_esn%
The header rule esn sets the value of the GI_ESN header to the ESN number of the handheld sending a request.
header.esn.
hosts
*
The header rule esn applies to HTTP requests sent to all hosts.
header.html_first.
header
Accept
The header rule html_first applies to the HTTP Accept header.
header.html_first.
value
text/html, %Accept%
The header rule html_first sets the value of the HTTP Accept header to text/html followed by the value of the Accept header as received from the handheld.
This has the effect of ensuring that the first element in the Accept header is always text/html.
header.html_first.
hosts
google.com
The header rule html_first applies only to google.com. If google.com receives an HTTP Accept header where
text/vnd.wap.wml is the first element, google.com returns a WML page.
The html_first rule ensures that google.com returns an HTML page to Good Intranet handhelds.
header.mozilla_ua.header
User-Agent
The rule mozilla_ua applies to the HTTP User-Agent header.
header.mozilla_ua.value
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; %User-Agent%)
The rule mozilla_ua sets the value of the User-Agent header to Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; followed by the handheld user-agent string, followed by a close-parenthesis.
header.mozilla_ua.hosts
hotmail.com google.com passport.com msn.com
The rule mozilla_ua applies to hotmail.com, google.com, passport.com, and msn.com.
These web sites may not recognize the handheld's user-agent string
(Good Intranet ...) but will see the handheld software as compatible with Mozilla/4.0 because of the value assigned through header.mozilla_ua.value.


Good Technology
www.good.com
Voice: 1 866-7-BE-GOOD
sales@good.com
PreviousNextIndex