mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
adds support for retrieving headers from the request and response objects
This commit is contained in:
@@ -571,6 +571,22 @@ public:
|
||||
// Pass-through access to the request and response objects //
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
/// Retrieve a request header
|
||||
/**
|
||||
* Retrieve the value of a header from the handshake HTTP request.
|
||||
*
|
||||
* @param key Name of the header to get
|
||||
*/
|
||||
const std::string & get_request_header(const std::string &key);
|
||||
|
||||
/// Retrieve a response header
|
||||
/**
|
||||
* Retrieve the value of a header from the handshake HTTP request.
|
||||
*
|
||||
* @param key Name of the header to get
|
||||
*/
|
||||
const std::string & get_response_header(const std::string &key);
|
||||
|
||||
/// Set response status code and message
|
||||
/**
|
||||
* Sets the response status code to `code` and looks up the corresponding
|
||||
|
||||
@@ -359,6 +359,19 @@ void connection<config>::select_subprotocol(const std::string & value) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <typename config>
|
||||
const std::string &
|
||||
connection<config>::get_request_header(const std::string &key) {
|
||||
return m_request.get_header(key);
|
||||
}
|
||||
|
||||
template <typename config>
|
||||
const std::string &
|
||||
connection<config>::get_response_header(const std::string &key) {
|
||||
return m_response.get_header(key);
|
||||
}
|
||||
|
||||
template <typename config>
|
||||
void connection<config>::set_status(
|
||||
http::status_code::value code)
|
||||
|
||||
Reference in New Issue
Block a user