Skip to content

Commit 4578ba3

Browse files
(http server) Do not overwrite response headers with request headers
1 parent d932af8 commit 4578ba3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ixwebsocket/IXHttpServer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ namespace ix
151151

152152
for (auto&& it : request->headers)
153153
{
154-
headers[it.first] = it.second;
154+
//Do not replace our explicitly set server headers with client headers
155+
if(!headers.count(it.first))
156+
{
157+
headers[it.first] = it.second;
158+
}
155159
}
156160

157161
return std::make_shared<HttpResponse>(

0 commit comments

Comments
 (0)