Item12590: Certain exceptions are rendered twice
Priority: Urgent
Current State: Closed
Released In: 1.1.9
Target Release: patch
Applies To: Engine
Component: FoswikiEngine
Branches: Release01x01 trunk
Any
EngineException
triggered in individual UI classes (or other switchboard handlers) is sent to the UA by
FoswikiUI using
$Foswiki::engine->finalizeError
. The same
Response
object is kept alive, though, and later sent to the UA
again, this time by
$Foswiki::engine->finalize
. Since the first go already created headers, the
Content-Length
header does not match the size of the actual response body generated. In some cases the web server will strip off the superfluous body parts, in others it will retain them – some web servers might mess up the response completely.
This could be considered a bug in either
FoswikiUI or
FoswikiEngine. The least invasive fix is to change
finalizeError
so that it empties the response object – that way the later call to
finalize
will be a no-op.
--
JanKrueger - 02 Oct 2013