default User-Agent and Accept headers
This commit is contained in:
@@ -257,6 +257,12 @@ fn send_prelude(unit: &Unit, method: &str, stream: &mut Stream) -> IoResult<()>
|
|||||||
if !has_header(&unit.headers, "host") {
|
if !has_header(&unit.headers, "host") {
|
||||||
write!(prelude, "Host: {}\r\n", unit.url.host().unwrap())?;
|
write!(prelude, "Host: {}\r\n", unit.url.host().unwrap())?;
|
||||||
}
|
}
|
||||||
|
if !has_header(&unit.headers, "user-agent") {
|
||||||
|
write!(prelude, "User-Agent: ureq\r\n")?;
|
||||||
|
}
|
||||||
|
if !has_header(&unit.headers, "accept") {
|
||||||
|
write!(prelude, "Accept: */*\r\n")?;
|
||||||
|
}
|
||||||
|
|
||||||
// other headers
|
// other headers
|
||||||
for header in &unit.headers {
|
for header in &unit.headers {
|
||||||
|
|||||||
Reference in New Issue
Block a user