Client IP restore does not work on 404 pages

Created on 19 June 2019, over 5 years ago
Updated 1 March 2023, over 1 year ago

In testing, we've spotted some requests coming into Drupal that do not end up with the right IP address. In particular, it's requests to 404 pages that don't seem to get the right IP address. I suspect this is happening because the EventSubscriber fires too late in the request cycle, and a 404 is generated very early.

I think the fix for this would be to reimplement the listener as HTTP middleware, with a similar priority to `Drupal\Core\StackMiddleware\ReverseProxyMiddleware`. This would allow the correct IP address to be in place prior to anything else happening (including session handling).

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rbayliss

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024