Include requestor IP in preview dummy_request?
See original GitHub issueWhen wagtailcore.models.Page.dummy_request
issues a dummy WSGIRequest
to compute preview content, should it defensively include a reasonable REMOTE_ADDR
header in case there are middleware installed which expect an IP address? Or should middleware always defensively handle the case where no requestor IP is provided?
Related to: https://github.com/Miserlou/django-easy-timezones/issues/6
I think it’s the responsibility of the middleware library to be defensive in this case, but curious if any Wagtail devs think it’s worth including a valid REMOTE_ADDR
in the request.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Add a True-Client-IP header to the request - Amazon CloudFront
The following example function adds a True-Client-IP HTTP header to the request, with the IP address of the viewer as the header's value....
Read more >How to mock the clients Ip address - Laracasts
Hi ; I am testing a Laravel 5.1 application which finds the user's location from his / her ip address. The problem is...
Read more >Fastly-Client-IP
When Fastly receives a request that does not include a Fastly-Client-IP header, we will add one, set to the current value of client.ip...
Read more >Continuous access evaluation - when client changes IP Address
"When a user's access is removed or a client IP address changes, ... Right now, as it's in preview, we do not have...
Read more >How to retrieve the client IP address of my users' requests?
To obtain the IP address of users on your original servers, we have added two HTTP headers to requests to your server: X-Forwarded-For...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have noticed that the missing
REMOTE_ADDR
header in the dummy request also causes an issue with django’s debug context processor, as it relies on this value to determine whether or not it should expose thedebug
context variable to the templates: https://github.com/django/django/blob/5153a3bfdcec82324d67ff79862384288cf6afe6/django/template/context_processors.py#L41so adding
REMOTE_ADDR
to the dummy request should fix this issue as well.Implemented in #2550.