Merge pull request #1 from elmato/websocket-header-access
Add access to HTTP request headers in websocket_connection
This commit is contained in:
commit
e1d6182763
2 changed files with 7 additions and 0 deletions
|
|
@ -29,6 +29,8 @@ namespace fc { namespace http {
|
||||||
void set_session_data( fc::any d ){ _session_data = std::move(d); }
|
void set_session_data( fc::any d ){ _session_data = std::move(d); }
|
||||||
fc::any& get_session_data() { return _session_data; }
|
fc::any& get_session_data() { return _session_data; }
|
||||||
|
|
||||||
|
virtual std::string get_request_header(const std::string& key) = 0;
|
||||||
|
|
||||||
fc::signal<void()> closed;
|
fc::signal<void()> closed;
|
||||||
private:
|
private:
|
||||||
fc::any _session_data;
|
fc::any _session_data;
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,11 @@ namespace fc { namespace http {
|
||||||
_ws_connection->close(code,reason);
|
_ws_connection->close(code,reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual std::string get_request_header(const std::string& key)override
|
||||||
|
{
|
||||||
|
return _ws_connection->get_request_header(key);
|
||||||
|
}
|
||||||
|
|
||||||
T _ws_connection;
|
T _ws_connection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue