mirror of
https://github.com/znc/znc.git
synced 2026-08-10 10:52:59 +02:00
HTTPSock: extract IsValidHeaderField helper and add tests (#2010)
This commit is contained in:
@@ -52,6 +52,10 @@ class CHTTPSock : public CSocket {
|
||||
unsigned int uStatusId = 200,
|
||||
const CString& sStatusMsg = "OK");
|
||||
void AddHeader(const CString& sName, const CString& sValue);
|
||||
/** Returns false if `s` contains CR or LF. Used by AddHeader to reject
|
||||
* inputs that could split the response into a separate header or body
|
||||
* (RFC 7230 disallows obs-fold; treat any bare CR/LF as invalid). */
|
||||
static bool IsValidHeaderField(const CString& s);
|
||||
void SetContentType(const CString& sContentType);
|
||||
|
||||
bool PrintNotFound();
|
||||
|
||||
Reference in New Issue
Block a user