IFPCWebPublishingProperties::SendAcceptEncodingHeader property

Applies to: desktop apps only

The SendAcceptEncodingHeader property gets or sets a Boolean value that indicates whether Forefront TMG sends the original Accept-Encoding header received from the client to the published server.

This property is read/write.

Syntax

HRESULT put_SendAcceptEncodingHeader(
  VARIANT_BOOL fSendAcceptEncodingHeader
);

HRESULT get_SendAcceptEncodingHeader(
  VARIANT_BOOL *pfSendAcceptEncodingHeader
);
' Data type: Boolean

Property SendAcceptEncodingHeader( _
  ByVal fSendAcceptEncodingHeader As VARIANT_BOOL, _
  ByVal pfSendAcceptEncodingHeader As VARIANT_BOOL _
) As Boolean

Property value

Boolean value that indicates whether Forefront TMG sends the original Accept-Encoding header received from the client to the published server.

Error codes

These property methods return S_OK if the call is successful; otherwise, they return an error code.

Remarks

This property is read/write. Its default value is False (VARIANT_FALSE in C++) for an ordinary Web publishing rule and True (VARIANT_TRUE in C++) for an Outlook Web Access publishing rule created using the Mail Publishing Rule Wizard (to allow the transmission of email messages with compressed attachments).

If a Web publishing rule allows the Forefront TMG computer to forward Accept-Encoding headers from clients to a Web server and a client sends an Accept-Encoding header indicating that it will accept compressed content, the Web server may send a compressed response (as indicated by its Content-Encoding header), which will be accepted by the Forefront TMG computer and forwarded to the client. However, the Forefront TMG computer will not inspect or cache the compressed content.

If a Web publishing rule instructs the Forefront TMG computer to delete all Accept-Encoding headers from requests sent to the Web server (the default setting) and the Web server nevertheless sends a compressed response, the Forefront TMG computer will not forward the response to the client.

In the forward proxy scenario, Accept-Encoding headers are always removed from client requests allowed by access rules.

The value of this property is considered only if the Compression Filter and Caching Compressed Content Filter are disabled. If these Web filters are enabled and are configured to forward requests for compressed content to the published server, Forefront TMG ignores this property and forwards Accept-Encoding headers that specify gzip encoding from clients to the published server, or adds an Accept-Encoding: gzip header to requests that do not contain this header before forwarding them to the published server. If these Web filters are enabled, but are not configured to forward requests for compressed content to the published server, Forefront TMG ignores this property and deletes any Accept-Encoding header supplied by a client from requests forwarded to the published server.

Examples

This VBScript script sets the SendAcceptEncodingHeader property to True for the specified Web publishing rule on the local Forefront TMG computer to allow the Forefront TMG computer to forward compressed content from the Web server to Web proxy clients.

' Define the constants needed
const Error_FileNotFound = &H80070002
Const fpcPolicyWebPublishing = 2
Main(WScript.Arguments)
Sub Main(args)
    If(args.Count = 1) Then
        AllowCompressedContent args(0)
    Else
        Usage()
    End If
End Sub
Sub AllowCompressedContent(ruleName)
    ' Create the root object.
    Dim root  ' The FPCLib.FPC root object
    Set root = CreateObject("FPC.Root")
    ' Declare the other objects needed.
    Dim isaArray        ' An FPCArray object
    Dim rule            ' An FPCPolicyRule object
    ' Get a reference to the array object.
    Set isaArray = root.GetContainingArray()
    ' Get a reference to the policy rule specified.
    On Error Resume Next
    Set rule = isaArray.ArrayPolicy.PolicyRules.Item(ruleName)
    If Err.Number = Error_FileNotFound Then
        WScript.Echo "The policy rule specified could not be found."
    Else
        Err.Clear
        On Error GoTo 0
        If rule.Type = fpcPolicyWebPublishing Then
            If rule.WebPublishingProperties.SendAcceptEncodingHeader = False _
                    Then
                rule.WebPublishingProperties.SendAcceptEncodingHeader = True
                rule.Save
                WScript.Echo "Done!"
            Else
                WScript.Echo "The policy rule specified already " & _ 
                    "allows forwarding of compressed content."
            End If
        Else
            WScript.Echo "The policy rule specified is not a Web publishing rule."
        End If
    End If
End Sub
Sub Usage()
    WScript.Echo "Usage:" & VbCrLf _
        & "  " & WScript.ScriptName & " RuleName" & VbCrLf _
        & "" & VbCrLf _
        & "    RuleName - Name of the Web publishing rule" 
    WScript.Quit
End Sub

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 (64-bit only)

Version

Forefront Threat Management Gateway (TMG) 2010

IDL

Msfpccom.idl

DLL

Msfpccom.dll

See also

FPCWebPublishingProperties

 

 

Build date: 7/12/2010