mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 18:32:29 +00:00
414f470c79
* Refactoring: part 1 * Refactoring: part 2 * Handle request using ReadBuffer interface * Struggles with ReadBuffer's * Fix URI parsing * Implement parsing of multipart/form-data * Check HTTP_LENGTH_REQUIRED before eof() or will hang * Fix HTTPChunkedReadBuffer * Fix build and style * Fix test * Resist double-eof * Fix arcadian build
36 lines
692 B
C++
36 lines
692 B
C++
#pragma once
|
|
|
|
#include <Server/HTTP/HTTPRequestHandler.h>
|
|
#include <common/types.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class IServer;
|
|
class WriteBuffer;
|
|
|
|
/// Response with custom string. Can be used for browser.
|
|
class StaticRequestHandler : public HTTPRequestHandler
|
|
{
|
|
private:
|
|
IServer & server;
|
|
|
|
int status;
|
|
String content_type;
|
|
String response_expression;
|
|
|
|
public:
|
|
StaticRequestHandler(
|
|
IServer & server,
|
|
const String & expression,
|
|
int status_ = 200,
|
|
const String & content_type_ = "text/html; charset=UTF-8");
|
|
|
|
void writeResponse(WriteBuffer & out);
|
|
|
|
void handleRequest(HTTPServerRequest & request, HTTPServerResponse & response) override;
|
|
};
|
|
|
|
}
|