##// END OF EJS Templates
More properly saving the ip address. This fixes #9
neko259 -
r70:f09290a1 default
parent child Browse files
Show More
@@ -49,7 +49,7 b' def new_post(request, thread_id=boards.m'
49 49 else:
50 50 image = None
51 51
52 ip = request.META['REMOTE_ADDR']
52 ip = _get_client_ip(request)
53 53
54 54 tags = []
55 55
@@ -181,4 +181,13 b' def all_tags(request):'
181 181
182 182
183 183 def _get_theme(request):
184 return request.session.get('theme', neboard.settings.DEFAULT_THEME) No newline at end of file
184 return request.session.get('theme', neboard.settings.DEFAULT_THEME)
185
186
187 def _get_client_ip(request):
188 x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
189 if x_forwarded_for:
190 ip = x_forwarded_for.split(',')[-1].strip()
191 else:
192 ip = request.META.get('REMOTE_ADDR')
193 return ip No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now