MXS-1220: Expand HttpResponse class

The class now generates default headers. The ETag and Last-Modified tags
do not represent any actual modification time or resource hash.

The basic functionality of the HTTP responses is tested by the core test
suite. More advanced testing of the whole REST API is still required.

Removed the static `create` functions as only the JSON parsing version
could generated errors and even then the errors were unlikely. By
replacing the static creator function with a normal constructor, the
HttpResponse class can now also be created on the stack making its use
easier.
This commit is contained in:
Markus Mäkelä
2017-04-17 03:13:22 +03:00
committed by Markus Mäkelä
parent a73d3e9276
commit 9d0d394361
7 changed files with 114 additions and 42 deletions

View File

@ -19,6 +19,7 @@
#include <maxscale/thread.h>
#include "http.hh"
#include "adminclient.hh"
using std::deque;
@ -29,8 +30,9 @@ typedef deque<SAdminClient> ClientList;
/** The admin interface configuration */
struct AdminConfig
{
string host;
uint16_t port;
string host;
uint16_t port;
enum http_auth auth;
};
class AdminListener
@ -87,4 +89,4 @@ void mxs_admin_shutdown();
*
* @return A reference to the administrative interface configuration
*/
AdminConfig& mxs_admin_get_config();
AdminConfig& mxs_admin_get_config();