From 170f4734e0cd7cf9106282c3f871b8dc54178443 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 29 Oct 2020 07:51:35 -0400 Subject: [PATCH] Bug 26692: (QA follow-up) Respond with 401 if patron is not logged in --- opac/svc/barcode | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opac/svc/barcode b/opac/svc/barcode index 2f60f23203..951026454d 100755 --- a/opac/svc/barcode +++ b/opac/svc/barcode @@ -23,6 +23,7 @@ use CGI qw(header); use GD::Barcode; use C4::Auth qw(checkauth); +use C4::Output qw(output_with_http_headers); =head1 NAME @@ -92,7 +93,10 @@ below the scannable barcode. my $input = CGI->new; my ( $user, $cookie, $sessionID, $flags ) = checkauth( $input, 1, {}, 'opac' ); -$user && $sessionID or response_bad_request("User not logged in"); +unless ( $user && $sessionID ) { + output_with_http_headers( $input, undef, undef, 'html', '401 Unauthorized' ); + exit; +} binmode(STDOUT); -- 2.24.1 (Apple Git-126)