Bug 27555 - Use psgi_env from errors/* controller scripts
Summary: Use psgi_env from errors/* controller scripts
Status: RESOLVED DUPLICATE of bug 29744
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 26048
Blocks:
  Show dependency treegraph
 
Reported: 2021-01-27 10:10 UTC by Jonathan Druart
Modified: 2022-03-28 09:27 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 27555: Use psgi_env from errors sripts (6.09 KB, patch)
2021-03-16 10:25 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2021-01-27 10:10:08 UTC
errors/* controller scripts are using
  any { /(^psgi\.|^plack\.)/i } keys %ENV
to know if we are running under psgi.

This is also defined in C4::Auth (psgi_env subroutine), but it's not available as it is in BEGIN.

We should put this trick in an exportable subroutine to make it accessible from pl scripts.
Comment 1 David Cook 2021-01-27 23:19:27 UTC
When I was working on Bug 26048, I thought it would be enough to check for environmental variables starting with "psgi." but I don't think they were being set,  but there were "plack." environmental variables. 

So we'd need to make sure to update "psgi_env" in C4::Auth if we did use it
Comment 2 Jonathan Druart 2021-03-16 10:25:04 UTC
Created attachment 118292 [details] [review]
Bug 27555: Use psgi_env from errors sripts
Comment 3 Jonathan Druart 2021-03-16 10:26:29 UTC
I don't understand why psgi_env and safe_exit were in the BEGIN block.
Should we expect a regression from CAS or Shib auth here?
Comment 4 Martin Renvoize (ashimema) 2021-03-16 14:05:21 UTC
Hmm, pass I'm afraid... I think that predates the work I did on Shibboleth.. I just used it.. Hopefully Matts knows?
Comment 5 Matthias Meusburger 2021-03-16 14:18:22 UTC
Hi, 

Actually, the psgi compatibility was written by eiro at the time, see https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=3551

That being said, I don't see why they should be in the BEGIN block either.
Comment 6 Jonathan Druart 2021-12-13 14:58:49 UTC

*** This bug has been marked as a duplicate of bug 29420 ***
Comment 7 Martin Renvoize (ashimema) 2022-03-28 09:27:09 UTC

*** This bug has been marked as a duplicate of bug 29744 ***