Merge pull request #1 from elmato/websocket-header-access

Add access to HTTP request headers in websocket_connection
This commit is contained in:
Vikram Rajkumar 2017-01-30 18:11:45 -06:00 committed by GitHub
commit e1d6182763
2 changed files with 7 additions and 0 deletions

View file

@ -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;

View file

@ -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;
}; };