question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include requestor IP in preview dummy_request?

See original GitHub issue

When 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:closed
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
steragocommented, Sep 22, 2015

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 the debug context variable to the templates: https://github.com/django/django/blob/5153a3bfdcec82324d67ff79862384288cf6afe6/django/template/context_processors.py#L41

so adding REMOTE_ADDR to the dummy request should fix this issue as well.

0reactions
gasmancommented, Jul 6, 2016

Implemented in #2550.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found