MythTV
master
|
#include <libmythbase/http/mythhttpresponse.h>
Public Member Functions | |
MythHTTPResponse ()=default | |
MythHTTPResponse (const HTTPRequest2 &Request) | |
void | Finalise (const MythHTTPConfig &Config) |
Complete all necessary headers, add final line break after headers, remove data etc. More... | |
template<class T > | |
std::enable_if_t< std::is_convertible_v< T, QString >, void > | AddHeader (const QString &key, const T &val) |
template<class T > | |
std::enable_if_t<!std::is_convertible_v< T, QString >, void > | AddHeader (const QString &key, T val) |
Static Public Member Functions | |
static HTTPResponse | HandleOptions (const HTTPRequest2 &Request) |
static HTTPResponse | ErrorResponse (MythHTTPStatus Status, const QString &ServerName) |
static HTTPResponse | RedirectionResponse (const HTTPRequest2 &Request, const QString &Redirect) |
static HTTPResponse | ErrorResponse (const HTTPRequest2 &Request, const QString &Message={}) |
static HTTPResponse | OptionsResponse (const HTTPRequest2 &Request) |
static HTTPResponse | DataResponse (const HTTPRequest2 &Request, const HTTPData &Data) |
static HTTPResponse | FileResponse (const HTTPRequest2 &Request, const HTTPFile &File) |
static HTTPResponse | EmptyResponse (const HTTPRequest2 &Request) |
static HTTPResponse | UpgradeResponse (const HTTPRequest2 &Request, MythSocketProtocol &Protocol, bool &Testing) |
Public Attributes | |
QString | m_serverName |
MythHTTPVersion | m_version { HTTPOneDotOne } |
MythHTTPConnection | m_connection { HTTPConnectionClose } |
std::chrono::milliseconds | m_timeout { HTTP_SOCKET_TIMEOUT_MS } |
MythHTTPStatus | m_status { HTTPBadRequest } |
MythHTTPRequestType | m_requestType { HTTPGet } |
int | m_allowed { HTTP_DEFAULT_ALLOWED } |
HTTPHeaders | m_requestHeaders { nullptr } |
HTTPContents | m_responseHeaders |
HTTPVariant | m_response { std::monostate() } |
Protected Member Functions | |
void | AddDefaultHeaders () |
void | AddContentHeaders () |
Definition at line 16 of file mythhttpresponse.h.
|
default |
|
explicit |
Definition at line 20 of file mythhttpresponse.cpp.
|
static |
Definition at line 192 of file mythhttpresponse.cpp.
Referenced by MythHTTPService::HTTPRequest(), MythHTTPFile::ProcessFile(), and MythHTTPRoot::RedirectRoot().
|
static |
Definition at line 216 of file mythhttpresponse.cpp.
Referenced by MythXSD::Error(), HandleOptions(), MythHTTPService::HTTPRequest(), MythHTTPFile::ProcessFile(), MythHTTPSocket::Read(), and MythHTTPSocket::Timeout().
|
static |
Definition at line 233 of file mythhttpresponse.cpp.
Referenced by MythHTTPService::HTTPRequest().
|
static |
Definition at line 243 of file mythhttpresponse.cpp.
|
static |
Definition at line 253 of file mythhttpresponse.cpp.
Referenced by HandleOptions().
|
static |
Definition at line 262 of file mythhttpresponse.cpp.
Referenced by MythWSDL::GetWSDL(), MythXSD::GetXSD(), MythHTTPService::HTTPRequest(), and MythHTTPRoot::RedirectRoot().
|
static |
Definition at line 273 of file mythhttpresponse.cpp.
Referenced by MythHTTPService::HTTPRequest(), and MythHTTPFile::ProcessFile().
|
static |
Definition at line 284 of file mythhttpresponse.cpp.
|
static |
Definition at line 389 of file mythhttpresponse.cpp.
Referenced by MythHTTPSocket::Read().
void MythHTTPResponse::Finalise | ( | const MythHTTPConfig & | Config | ) |
Complete all necessary headers, add final line break after headers, remove data etc.
Definition at line 34 of file mythhttpresponse.cpp.
|
inline |
Definition at line 35 of file mythhttpresponse.h.
Referenced by AddContentHeaders(), AddDefaultHeaders(), MythHTTPEncoding::Compress(), and Finalise().
|
inline |
Definition at line 42 of file mythhttpresponse.h.
|
protected |
Definition at line 292 of file mythhttpresponse.cpp.
|
protected |
Definition at line 315 of file mythhttpresponse.cpp.
QString MythHTTPResponse::m_serverName |
Definition at line 48 of file mythhttpresponse.h.
Referenced by AddDefaultHeaders().
MythHTTPVersion MythHTTPResponse::m_version { HTTPOneDotOne } |
Definition at line 49 of file mythhttpresponse.h.
Referenced by AddDefaultHeaders(), and MythHTTPEncoding::Compress().
MythHTTPConnection MythHTTPResponse::m_connection { HTTPConnectionClose } |
Definition at line 50 of file mythhttpresponse.h.
Referenced by AddDefaultHeaders().
std::chrono::milliseconds MythHTTPResponse::m_timeout { HTTP_SOCKET_TIMEOUT_MS } |
Definition at line 51 of file mythhttpresponse.h.
Referenced by AddDefaultHeaders().
MythHTTPStatus MythHTTPResponse::m_status { HTTPBadRequest } |
Definition at line 52 of file mythhttpresponse.h.
Referenced by AddContentHeaders(), AddDefaultHeaders(), MythHTTPRanges::BuildMultipartHeaders(), Finalise(), and MythHTTPRanges::HandleRangeRequest().
MythHTTPRequestType MythHTTPResponse::m_requestType { HTTPGet } |
Definition at line 53 of file mythhttpresponse.h.
Referenced by Finalise().
int MythHTTPResponse::m_allowed { HTTP_DEFAULT_ALLOWED } |
Definition at line 54 of file mythhttpresponse.h.
Referenced by Finalise().
HTTPHeaders MythHTTPResponse::m_requestHeaders { nullptr } |
Definition at line 55 of file mythhttpresponse.h.
Referenced by AddDefaultHeaders(), MythHTTPEncoding::Compress(), and Finalise().
HTTPContents MythHTTPResponse::m_responseHeaders |
Definition at line 56 of file mythhttpresponse.h.
Referenced by AddDefaultHeaders(), and Finalise().
HTTPVariant MythHTTPResponse::m_response { std::monostate() } |
Definition at line 57 of file mythhttpresponse.h.
Referenced by AddContentHeaders(), MythHTTPRanges::BuildMultipartHeaders(), MythHTTPEncoding::Compress(), Finalise(), and MythHTTPRanges::HandleRangeRequest().