File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,34 +208,6 @@ def guess_filename(obj, default=None):
208208 return default
209209
210210
211- def parse_remote_addr (forward ):
212- if isinstance (forward , str ):
213- # we only took the last one
214- # http://en.wikipedia.org/wiki/X-Forwarded-For
215- if ',' in forward :
216- forward = forward .rsplit (',' , 1 )[- 1 ].strip ()
217-
218- # find host and port on ipv6 address
219- if '[' in forward and ']' in forward :
220- host = forward .split (']' )[0 ][1 :].lower ()
221- elif ':' in forward and forward .count (':' ) == 1 :
222- host = forward .split (':' )[0 ].lower ()
223- else :
224- host = forward
225-
226- forward = forward .split (']' )[- 1 ]
227- if ':' in forward and forward .count (':' ) == 1 :
228- port = forward .split (':' , 1 )[1 ]
229- else :
230- port = 80
231-
232- remote = (host , port )
233- else :
234- remote = forward
235-
236- return remote [0 ], str (remote [1 ])
237-
238-
239211class AccessLogger :
240212 """Helper object to log access.
241213
You can’t perform that action at this time.
0 commit comments