Skip to content

Commit 7aa7dcd

Browse files
committed
removed default user-agent and origin headers
1 parent dc8807e commit 7aa7dcd

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

ixwebsocket/IXHttpClient.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,17 @@ namespace ix
204204
}
205205

206206
// Set a default User agent if none is present
207-
if (args->extraHeaders.find("User-Agent") == args->extraHeaders.end())
207+
/*if (args->extraHeaders.find("User-Agent") == args->extraHeaders.end())
208208
{
209209
ss << "User-Agent: " << userAgent() << "\r\n";
210-
}
210+
}*/
211211

212-
// Set an origin header if missing
213-
if (args->extraHeaders.find("Origin") == args->extraHeaders.end())
212+
// Set an
213+
// header if missing
214+
/*if (args->extraHeaders.find("Origin") == args->extraHeaders.end())
214215
{
215216
ss << "Origin: " << protocol << "://" << host << ":" << port << "\r\n";
216-
}
217+
}*/
217218

218219
if (verb == kPost || verb == kPut || verb == kPatch || _forceBody)
219220
{

ixwebsocket/IXWebSocketHandshake.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@ namespace ix
121121
ss << "Sec-WebSocket-Key: " << secWebSocketKey << "\r\n";
122122

123123
// User-Agent can be customized by users
124-
if (extraHeaders.find("User-Agent") == extraHeaders.end())
125-
{
126-
ss << "User-Agent: " << userAgent() << "\r\n";
127-
}
128-
129-
// Set an origin header if missing
130-
if (extraHeaders.find("Origin") == extraHeaders.end())
131-
{
132-
ss << "Origin: " << protocol << "://" << host << ":" << port << "\r\n";
133-
}
124+
//if (extraHeaders.find("User-Agent") == extraHeaders.end())
125+
//{
126+
// ss << "User-Agent: " << userAgent() << "\r\n";
127+
//}
128+
129+
//// Set an origin header if missing
130+
//if (extraHeaders.find("Origin") == extraHeaders.end())
131+
//{
132+
// ss << "Origin: " << protocol << "://" << host << ":" << port << "\r\n";
133+
//}
134134

135135
for (auto& it : extraHeaders)
136136
{

0 commit comments

Comments
 (0)