Skip to content

Commit 149077f

Browse files
author
Sebastiano Merlino
committed
Due to some browsers lack of support the cookies are now split in
multiple headers
1 parent 16c3238 commit 149077f

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/http_response.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,8 @@ void http_response::decorate_response(MHD_Response* response)
129129
MHD_add_response_header(response, (*it).first.c_str(), (*it).second.c_str());
130130
for (it=footers.begin() ; it != footers.end(); ++it)
131131
MHD_add_response_footer(response, (*it).first.c_str(), (*it).second.c_str());
132-
{
133-
bool first = true;
134-
stringstream ss;
135-
for (it=cookies.begin(); it != cookies.end(); ++it)
136-
{
137-
if(!first)
138-
ss << ", ";
139-
else
140-
first = false;
141-
ss << (*it).first << "=" << (*it).second;
142-
}
143-
if(!first)
144-
MHD_add_response_header(response, "Set-Cookie", ss.str().c_str());
145-
}
132+
for (it=cookies.begin(); it != cookies.end(); ++it)
133+
MHD_add_response_header(response, "Set-Cookie", ((*it).first + "=" + (*it).second).c_str());
146134
}
147135

148136
void cache_response::decorate_response(MHD_Response* response)

0 commit comments

Comments
 (0)