Skip to content

Commit

Permalink
Only set sec-websocket-extensions if we have an offer
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Mar 1, 2019
1 parent b4b4225 commit 2afe6a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ struct TemplatedApp {
extensionsNegotiator.readOffer(extensions);

/* Todo: remove these mid string copies */
res->writeHeader("Sec-WebSocket-Extensions", extensionsNegotiator.generateOffer());
std::string offer = extensionsNegotiator.generateOffer();
if (offer.length()) {
res->writeHeader("Sec-WebSocket-Extensions", offer);
}

/* Did we negotiate permessage-deflate? */
if (extensionsNegotiator.getNegotiatedOptions() & PERMESSAGE_DEFLATE) {
Expand Down

0 comments on commit 2afe6a6

Please sign in to comment.