Use iteration instead of recursion for connect (#291)
This allows handling larger redirect chains. Fixes #290
This commit is contained in:
@@ -118,7 +118,7 @@ impl Request {
|
||||
}
|
||||
let reader = payload.into_read();
|
||||
let unit = Unit::new(&self.agent, &self.method, &url, &self.headers, &reader);
|
||||
let response = unit::connect(unit, true, reader, None).map_err(|e| e.url(url.clone()))?;
|
||||
let response = unit::connect(unit, true, reader).map_err(|e| e.url(url.clone()))?;
|
||||
|
||||
if response.status() >= 400 {
|
||||
Err(Error::Status(response.status(), response))
|
||||
|
||||
Reference in New Issue
Block a user