[Koha-bugs] [Bug 29420] HTTP status code incorrect when calling error pages directly under Plack/PSGI

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Dec 3 09:35:06 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29420

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #128115|0                           |1
        is obsolete|                            |

--- Comment #19 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 128204
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128204&action=edit
Bug 29420: HTTP status code incorrect when calling error pages directly under
Plack/PSGI

The error pages wrote a HTTP status code of 200 for all PSGI requests, even
though it should have only done it for PSGI requests from the ErrorDocument
middleware. This patch fixes that.

0) Do not apply patch
1) Open F12 dev tools and go to Network tab
2) Go to http://localhost:8081/files/blah
3) Note that the webpage is a 404 error but HTTP status code is 200
4) Go to http://localhost:8081/cgi-bin/koha/circ/blah
5) Note that the webpage is a 404 error and HTTP status code is 404

6) Apply patch
7) Go to http://localhost:8081/files/blah
8) Note that the webpage is a 404 error and HTTP status code is 404
9) Go to http://localhost:8081/cgi-bin/koha/circ/blah
10) Note that the webpage is a 404 error and HTTP status code is 404

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list