[Koha-bugs] [Bug 17050] Accessing the REST API through Plack kicks the session out

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 5 17:09:08 CEST 2016


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

--- Comment #3 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 54054
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54054&action=edit
Bug 17050: Do not kicks the session out when accessing the REST API

Mojolicious does not set $ENV{REMOTE_ADDR} (and $ENV{HTTP_*} neither) as
it may share ENV between different requests.
Fortunately for us, Plack does not!

This is a dirty patch to fix this issue but it seems that there is not
lot of solutions. It adds a remote_addr parameter to
C4::Auth::check_cookie_authin order to send it from
Koha::Rest::V1::startup reading the headers sent by Mojolicious.

Test plan:
Hit /cgi-bin/koha/mainpage.pl
Hit /api/v1/patrons/42
Hit /cgi-bin/koha/mainpage.pl

With this patch applied, everything will be fine and you won't be
logged out.

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


More information about the Koha-bugs mailing list