forked from tornadoweb/tornado
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for ticket tornadoweb#904 - Addition of get_claimed_ip() to HTTPR…
…equest As per ticket description of ticket tornadoweb#904, a method to return the first public IP address from X-Forwarded-For should be implemented. This update contains the below changes: 1. In tornado/httpserver.py HTTPRequest.get_claimed_ip() is implemented which simply returns remote_ip 2. In tornado/test/httpserver_test.py The test for verifying ip_headers already existed in XHeaders. I simply modified the internal class Handler to retrieve the output of get_claimed_ip from the request messge and write it to the dictionary. The same tests that were written for verifying ip_headers have been re-used except that they now check that remote ip equals claimed_ip
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters