Issue 1:
(gdb) py-list

544 # Guard against that specific failure case.

545 if not isinstance(request, PreparedRequest):

546 raise ValueError('You can only send PreparedRequests.')

547

548 while request.url in self.redirect_cache:

-549 request.url = self.redirect_cache.get(request.url)

550

551 # Set up variables needed for resolve_redirects and dispatching of hooks

552 allow_redirects = kwargs.pop('allow_redirects', True)

553 stream = kwargs.get('stream')

554 timeout = kwargs.get('timeout')

redirect_cache dict could have complementary key/values that forces and enless loop.

(gdb) py-down

2 Frame 0x7f645c00acd0, for file /test/libs/requests/sessions.py, line 549, in send (self=<Session(cookies=<RequestsCookieJar(_now=1410944130, _policy=<DefaultCookiePolicy(strict_rfc2965_unverifiable=True, strict_ns_domain=0, _allowed_domains=None, rfc2109_as_netscape=None, rfc2965=False, strict_domain=False, _now=1410944130, strict_ns_set_path=False, strict_ns_unverifiable=False, strict_ns_set_initial_dollar=False, hide_cookie2=False, _blocked_domains=(), netscape=True) at remote 0x7f651070c4d0>, _cookies={}, _cookies_lock=<_RLock(_Verbose__verbose=False, _RLock__owner=None, _RLock__block=<thread.lock at remote 0x7f6530772dd0>, _RLock__count=0) at remote 0x7f65105a5450>) at remote 0x7f65105a5e10>, stream=False, hooks={'response': []}, redirect_cache={'http://www.hent aiwe blog.com/': 'http://hent aiwe blog.com/', 'http://hent aiwe blog.com/': 'http://www.hent aiwe blog.com/'}, auth=None, trust_env=True, headers=<CaseInsensitiveDict(_store={'accept-encoding': ('Accept-Encoding', 'gzip, deflate'), 'accep...(truncated)

request.url = self.redirect_cache.get(request.url)

Current request chain with wget:

$ wget www.hent aiwe blog.com

--2014-09-18 11:52:20-- http://www.hent aiwe blog.com/

Resolving www.hent aiwe blog.com (www.hent aiwe blog.com)... 109.72.81.172

Connecting to www.hent aiwe blog.com (www.hent aiwe blog.com)|109.72.81.172|:80... connected.

HTTP request sent, awaiting response... 301 Moved Permanently

Location: http://hent aiwe blog.com/ [following]

--2014-09-18 11:52:20-- http://hent aiwe blog.com/

Resolving hent aiwe blog.com (hent aiwe blog.com)... 109.72.81.172

Reusing existing connection to www.hent aiwe blog.com:80.

HTTP request sent, awaiting response... 301 Moved Permanently

Location: http://www.hent aiwe blog.com/ [following]

--2014-09-18 11:52:20-- http://www.hent aiwe blog.com/

Reusing existing connection to www.hent aiwe blog.com:80.

HTTP request sent, awaiting response... 301 Moved Permanently

Location: http://hent aiwe blog.com/ [following]

...

Suggested resolution:

redirect_count = 0
while request.url in self.redirect_cache:
redirect_count += 1
if redirect_count > self.max_redirects:
raise TooManyRedirects
request.url = self.redirect_cache.get(request.url)

Issue 2:
When requesting a URL (get/post), Requests normalizes the URL.

For example:

r = requests.get("http://123.123.123.123/../../../../../../test")
print(str(r.status_code))

Expected Result

GET /../../../../../../test HTTP/1.1
Host: 123.123.123.123
Connection: close
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.22.0

Actual Result

GET /test HTTP/1.1
Host: 123.123.123.123
Connection: close
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.22.0

Reproduction Steps

import requests
r = requests.get("http://123.123.123.123/../../../../../../test")
print(str(r.status_code))

System Information

{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.8"
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "2.7.17"
},
"platform": {
"release": "5.3.0-51-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010104f",
"version": "17.5.0"
},
"requests": {
"version": "2.22.0"
},
"system_ssl": {
"version": "1010100f"
},
"urllib3": {
"version": "1.25.6"
},
"using_pyopenssl": true
}