Microsoft KB Archive/290569

= PRB: #exec Directive with IIS Buffering Displays HTTP Headers in Browser =

Article ID: 290569

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft Internet Information Services 5.0
 * Microsoft Internet Information Server 4.0
 * Microsoft Internet Information Server 4.0
 * Microsoft Visual InterDev 1.0 Standard Edition
 * Microsoft Visual InterDev 6.0 Standard Edition

-



This article was previously published under Q290569



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx



SYMPTOMS
When you utilize the Server Side Include (SSI) #exec directive to call an Active Server Pages (ASP) page, and buffering is enabled, the content is processed and loaded but the ASP page also displays the HTTP headers.

The syntax is as follows:
 * 1) EXEC CGI = &quot;/YOUR.ASP&quot;



CAUSE
The HTTP headers appear with the #exec command when it calls an ASP page that has buffering enabled. Because the buffering stores all data that is created when the ASP is processed, and #exec calls everything from the buffer, the ASP page includes the HTTP headers. If buffering is not enabled, the request is processed as it would be in response to any other client (that is, without displaying the HTTP headers).



RESOLUTION
There are three ways to work around this problem:
 * Turn off buffering in IIS. To do this, follow these steps:
 * In the IIS Microsoft Management Console (MMC), right-click the Web site and click Properties.
 * Click the Home Directory tab and click Configuration.
 * Click the App Option tab and clear Enable Buffering.
 * Turn off buffering on the called pages. To do this, set Response.Buffer to False at the top of the pages that #exec calls. This causes buffering to be turned off on these pages, but still allows buffering for the site.
 * Flush the buffer before it responds to #exec. To do this, place the Response.Flush command at the top of the pages that #exec calls.



MORE INFORMATION
Buffering refers to when script commands are processed and stored before content is sent to the client. You can enable buffering in IIS either through IIS management tools or by using the Response.Buffer = true command on the page.

When buffering is enabled in IIS, buffering is set on all pages. In IIS version 4.0 buffering is turned off by default; in IIS version 5.0, buffering is turned on by default.

Keywords: kbprb KB290569

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.