fix: check the request's headers rather than the empty response's headers for User-Agent and Accept (#296)
This commit is contained in:
parent
26897b2425
commit
bbe2ae6dd3
@ -190,14 +190,14 @@ namespace ix
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set a default Accept header if none is present
|
// Set a default Accept header if none is present
|
||||||
if (headers.find("Accept") == headers.end())
|
if (args->extraHeaders.find("Accept") == args->extraHeaders.end())
|
||||||
{
|
{
|
||||||
ss << "Accept: */*"
|
ss << "Accept: */*"
|
||||||
<< "\r\n";
|
<< "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a default User agent if none is present
|
// Set a default User agent if none is present
|
||||||
if (headers.find("User-Agent") == headers.end())
|
if (args->extraHeaders.find("User-Agent") == args->extraHeaders.end())
|
||||||
{
|
{
|
||||||
ss << "User-Agent: " << userAgent() << "\r\n";
|
ss << "User-Agent: " << userAgent() << "\r\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user