Bug 23723: using exit inside eval to stop sending output to browser doesn't work...
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 3 Oct 2019 07:34:17 +0000 (09:34 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 7 Oct 2019 11:21:30 +0000 (12:21 +0100)
commit43d999cc7c7edc54e3df7482b3ab3607755e4b6d
tree5aff7663e6d1a7472ca3875a775f975c666701de
parenta4bee10d0b73e12721e65908283a37a675bb44c4
Bug 23723: using exit inside eval to stop sending output to browser doesn't work under plack

When fixing Bug 23589 Theodoros Theodoropoulos noticed that we are sending
headers and html after pdf output to browser.

Using exit inside eval block doesn't stop plack from generating
headers and html page after exit since CGI::Compile will catch
exit but doesn't stop emiting output. Example is:

eval {
warn "in eval";
exit;
};
warn "after eval";

Under CGI, this would print just "in eval", but under plack we get both lines
and thus generate additional header and html after we already sent pdf data.

Signed-off-by: Theodoros Theodoropoulos <theod@lib.auth.gr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
members/discharge.pl
opac/opac-discharge.pl