SendAcceptEncodingHeader Property of the IFPCWebPublishingProperties Interface
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.
C++
HRESULT put_SendAcceptEncodingHeader(
VARIANT_BOOL fSendAcceptEncodingHeader
);
HRESULT get_SendAcceptEncodingHeader(
VARIANT_BOOL* pfSendAcceptEncodingHeader
);
Parameters
fSendAcceptEncodingHeader
Boolean value that indicates whether Forefront TMG sends the original Accept-Encoding header received from the client to the published server.pfSendAcceptEncodingHeader
Pointer to a Boolean variable that is set on return to VARIANT_TRUE if Forefront TMG sends the original Accept-Encoding header received from the client to the published server, or to VARIANT_FALSE if Forefront TMG deletes any Accept-Encoding header supplied by the client from the request forwarded to the published server.
Return Value
These property methods return S_OK if the call is successful; otherwise, they return an error code.
Visual Basic
Property SendAcceptEncodingHeader 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.
Example Code
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
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 e-mail 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.
Requirements
Client | Requires Windows 7 or Windows Vista. |
Server | Requires Windows Server 2008 R2 or Windows Server 2008 x64 Edition with SP2. |
Version | Requires Forefront Threat Management Gateway (TMG) 2010. |
IDL | Declared in Msfpccom.idl. |
DLL | Requires Msfpccom.dll. |
See Also
Send comments about this topic to Microsoft
Build date: 6/30/2010