websocket key for server side

This commit is contained in:
zhengshuxin 2019-08-09 22:36:54 +08:00
parent 7bcb88ae3c
commit 03896a6a12
2 changed files with 1 additions and 13 deletions

View File

@ -356,7 +356,6 @@ public:
}
http_header& set_ws_accept(const char* key);
http_header& set_ws_accept(const void* key, size_t len);
const char* get_ws_accept(void) const
{
return ws_sec_accept_;

View File

@ -821,18 +821,7 @@ http_header& http_header::set_ws_version(int ver)
http_header& http_header::set_ws_accept(const char* key)
{
if (key && *key) {
return set_ws_accept(key, strlen(key));
} else {
return *this;
}
}
http_header& http_header::set_ws_accept(const void* key, size_t len)
{
if (key) {
string buf;
buf.base64_encode(key, len);
ws_sec_key_ = dbuf_->dbuf_strdup(buf.c_str());
ws_sec_key_ = dbuf_->dbuf_strdup(key);
}
return *this;
}