mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-29 05:17:59 +03:00
feat: add headersize
This commit is contained in:
@@ -8,6 +8,8 @@ Request::Request()
|
||||
_ret = 200;
|
||||
_contentLength = 0;
|
||||
_chunked = false;
|
||||
_head_ok = false;
|
||||
_body_ok = false;
|
||||
}
|
||||
|
||||
Request::Request(char *str)
|
||||
@@ -71,6 +73,16 @@ bool Request::getChunked(void)
|
||||
{
|
||||
return (_chunked);
|
||||
}
|
||||
|
||||
unsigned int Request::getContentLength(void) const
|
||||
{
|
||||
return (_contentLength);
|
||||
}
|
||||
unsigned int Request::getHeaderSize(void) const
|
||||
{
|
||||
return (_headerSize);
|
||||
}
|
||||
|
||||
void Request::setData(char *str)
|
||||
{
|
||||
this->_data = str;
|
||||
@@ -142,6 +154,7 @@ void Request::splitData(char *data)
|
||||
return;
|
||||
}
|
||||
_head = str.substr(0, pos) + "\n";
|
||||
_headerSize = _head.size() + 3;
|
||||
str.erase(0, pos + 4);
|
||||
_head_ok = true;
|
||||
parseHeader();
|
||||
|
||||
Reference in New Issue
Block a user