[koha-commits] main Koha release repository branch master updated. v16.05.00-529-gadbcaa9

Git repo owner gitmaster at git.koha-community.org
Tue Aug 23 15:40:59 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "main Koha release repository".

The branch, master has been updated
       via  adbcaa99f4f1a0dc3c739cb15b4d3039d2a79c9e (commit)
       via  b5fc3d29373d2b6eecd9f3d26c798d603dae7d84 (commit)
      from  3315a883ed055554627c26ace0581e8fd6426b83 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit adbcaa99f4f1a0dc3c739cb15b4d3039d2a79c9e
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date:   Fri Aug 19 14:59:04 2016 -0300

    Bug 17050: (QA followup) Use Mojo::Transaction to get the remote address
    
    While the original patch fixes the issue, reading at Mojolicious source code, revealed
    that Mojo::Transaction already has proper processing for detecting the remote address:
    
    sub remote_address {
      my $self = shift;
    
      return $self->original_remote_address(@_) if @_;
      return $self->original_remote_address unless $self->req->reverse_proxy;
    
      # Reverse proxy
      return ($self->req->headers->header('X-Forwarded-For') // '') =~ /([^,\s]+)$/
        ? $1
        : $self->original_remote_address;
    }
    
    Without this patch, if there's a request without HTTP_X_FORWARDED_FOR, then the remote
    address would be empty. Such would be the case of a dev/standard setup without Plack.
    
    This patch makes Koha::REST::V1::startup use tx->remote_address instead of dealing with the
    headers on its own.
    
    Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
    Signed-off-by: Benjamin Rokseth <benjamin.rokseth at kul.oslo.kommune.no>
    
    Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
    
    Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

commit b5fc3d29373d2b6eecd9f3d26c798d603dae7d84
Author: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Date:   Fri Aug 5 15:03:28 2016 +0000

    Bug 17050: Do not kick the session out when accessing the REST API
    
    Mojolicious does not set $ENV{REMOTE_ADDR} (neither $ENV{HTTP_*}) 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.
    
    Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
    Signed-off-by: Benjamin Rokseth <benjamin.rokseth at kul.oslo.kommune.no>
    
    Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
    
    Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

-----------------------------------------------------------------------

Summary of changes:
 C4/Auth.pm      |    4 +++-
 Koha/REST/V1.pm |    7 ++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
main Koha release repository


More information about the koha-commits mailing list