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

--- Comment #54 from David Cook <[email protected]> ---
The problem is Koha::Middleware::SetEnv. It's a fundamentally flawed
middleware.

The wrapping of middleware works by passing around a hash reference (ie $env),
and Koha::Middleware::SetEnv breaks the referential train.

It passes a new hashref to Koha::Middleware::RealIP which then passes that new
reference to the Koha app. 

But when the post-processing aspect of the Plack middleware runs, after leaving
the Koha::Middleware::SetEnv wrapper, it goes back to Plack::Middleware::Static
which has the *original* reference, which undoes the changes of
Koha::Middleware::SetEnv wrapper and Koha::Middleware::RealIP.

We don't notice this because a lot of our middleware only "pre-process". But
Plack::Middleware::AccessLog" is a "post-process" middleware.

This should actually be a fairly easy fix, and it'll fix the IP address in
plack.log when running behind a reverse proxy.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to