Bugzilla – Attachment 127328 Details for
Bug 29420
HTTP status code incorrect when calling error pages directly under Plack/PSGI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29420 - 401 Unauthorized pages come back is 200 OK under plack
Bug-29420---401-Unauthorized-pages-come-back-is-20.patch (text/plain), 1.98 KB, created by
Liz Rea
on 2021-11-05 00:01:39 UTC
(
hide
)
Description:
Bug 29420 - 401 Unauthorized pages come back is 200 OK under plack
Filename:
MIME Type:
Creator:
Liz Rea
Created:
2021-11-05 00:01:39 UTC
Size:
1.98 KB
patch
obsolete
>From bb19c9c62dca6e07a34c14e1da6e10cdda74d23a Mon Sep 17 00:00:00 2001 >From: Liz Rea <liz@bywatersolutions.com> >Date: Thu, 4 Nov 2021 18:56:17 -0500 >Subject: [PATCH] Bug 29420 - 401 Unauthorized pages come back is 200 OK under > plack > >To test: > >- create an alias in your /etc/koha/sites/<site>.conf file for something like files > Alias /files "/var/lib/koha/kohadev/public_html/" > <Directory "/var/lib/koha/kohadev/public_html/"> > Options +Indexes > AuthUserFile /var/lib/koha/kohadev/.htpasswd > AuthName ByPassword > AuthType Basic > <Limit GET POST PUT> > require valid-user > </Limit> > </Directory> >- make a .htpasswd file: https://hostingcanada.org/htpasswd-generator/ and put it in /var/lib/koha/kohadev >- restart apache >- navigate to http://<kohadev url>/files, note that the response header in the browser inspector says "200 OK" and the basic auth user/pass is not shown >- Apply this patch, restart the things >- navigate to http://<kohadev url>/files, note that the response header in the browser inspector says "401 Unauthorized" and the basic auth user/pass is now shown >--- > errors/401.pl | 2 +- > opac/errors/401.pl | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/errors/401.pl b/errors/401.pl >index 5cc3ac432d..2531262f40 100755 >--- a/errors/401.pl >+++ b/errors/401.pl >@@ -38,6 +38,6 @@ $template->param ( > ); > my $status = '401 Unauthorized'; > if ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) { >- $status = '200 OK'; >+ $status = '401 Unauthorized'; > } > output_with_http_headers $query, $cookie, $template->output, 'html', $status; >diff --git a/opac/errors/401.pl b/opac/errors/401.pl >index 91fbc2dccc..f9852b7f11 100755 >--- a/opac/errors/401.pl >+++ b/opac/errors/401.pl >@@ -39,6 +39,6 @@ $template->param ( > ); > my $status = '401 Unauthorized'; > if ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) { >- $status = '200 OK'; >+ $status = '401 Unauthorized'; > } > output_with_http_headers $query, $cookie, $template->output, 'html', $status; >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29420
:
127328
|
127364
|
128115
|
128204
|
132974