Ok was able to repro and figured this out. It's a bit of mess, but I think the following will work:
* Remove the Response.ContentTypeHeader("NONE") from ExpandScript
* In wwScripting check the RenderAspScript method to:
************************************************************************FUNCTION RenderAspScript(lcTemplate as string)******************************************LOCAL loException, lcOutFile, lcFile, lcFXPFile, lcWCTFile, lcVFPCode,; lcFileName, lcFXPFile, lcWCTFile, llNeedToCompileIFEMPTY(THIS.cCompiledPath)this.cCompiledPath = JUSTPATH(lcTemplate) + "\"ELSEthis.cCompiledPath = ADDBS(THIS.cCompiledPath) ENDIFthis.cCurrentTemplate = lcTemplate*** Figure out our filenames to use lcFileName = JUSTFNAME(lcTemplate) lcFXPFile = FORCEEXT(THIS.cCompiledPath + lcFileName,"FXP")this.lError = .f.IFthis.lNoVersionCheck llNeedToCompile = .F.ELSE llNeedToCompile = .T.TRY*** This catches both fxp file not existing and being out of date*** Slightly more efficient than checking file, and the dates llNeedToCompile = FDATE(lcFxpFile,1) < FDATE(lcTemplate,1)CATCH llNeedToCompile = .t.ENDTRY*** Create and compile the file only if it doesn't exist*** or the timestamp of the FXP is older than the source file*** NOTE: Must use SYS(2000) instead of file so we don't look for files in the EXE!IF llNeedToCompileIF !this.ConvertAndCompileScript(lcTemplate)RETURNthis.AspScriptErrorResponse()ENDIFENDIFENDIF*** Output generated into this variablePRIVATE _Out _Out = ""*** Response object for the page object - writes to _OutPRIVATE Response LOCAL llResponseCreated && Add this variableIFISNULL(this.oResponse) Response = this.CreateResponse() llResponseCreated = .T.ELSE Response = this.oResponse llResponseCreated = .F.ENDIF loException = nullIFthis.lStopOnError*** fail and stop in the generated PRG fileDO (lcFXPFile) &&WITH lcOutputELSETRY*** Just execute the PRG FileDO (lcFxpFile) && WITH lcOutputCATCHTO loExceptionthis.lError = .t.this.cErrormsg = loException.Message*IF EMPTY(loException.LineContents) lcFile = FILE2VAR( FORCEEXT(lcFxPFile,"prg") )IF !EMPTY(lcFile)LOCAL lnCodeLines lnCodeLines = ALINES(laLines,lcFile)IF lnCodeLines > 0 AND loException.LineNo<= lnCodeLines loException.LineContents = ALLTRIM(laLines[loException.Lineno])ENDIFENDIF*ENDIFthis.oException = loExceptionENDTRYENDIFIFTHIS.lError _Out = this.AspScriptErrorResponse()*!* ELSE *!* _Out = this.oResponse.GetOutput()ENDIFIF (llResponseCreated) && change this IF from the class comparison beforeIFthis.lError Response.Status = "500 Server Error" Response.ContentType = "text/html"ENDIF _Out = Response.RenderHttpHeader() + _OutENDIFRETURN _OutENDFUNC
Specifically in the code the logic that dealt with how to figure out whether to render the header or not resulted in the original headers being thrown out and the old headers not getting written. With the code above this now works properly. The idea is if a Response object is passed in - leave all the headers previously set intact. Otherwise add them explicitly.
Let me know if this works.
+++ Rick ---