diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2021-07-13 13:03:10 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-07-13 14:07:57 +0200 |
commit | 79408870680c7d9fa623b2b8022308aed9956038 (patch) | |
tree | 674345ce3fed2bd3fd25e3f20e8264776633be1a /src/restRequest.py | |
parent | b5c3f58cc4ce8e2fd953bd64a59b58681aeecdb4 (diff) |
#1000 Fix HTTP request header length parsing
OgClient miscalculates the body size of the request.
ogServer delimits HTTP headers with "\r\n\r\n" to comply with RFC 2616.
But ogClient searches for the first "\r\n" delimiter, hence, ogClient
stops at the first HTTP header field instead of at the end of the header.
Hence, it incorrectly assumes the body starts after the first "\r\n".
This commit updates ogClient to search for the "\r\n\r\n" delimiter.
Example:
POST /shell/run HTTP/1.1\r\n <-- ogClient considers body starts here (WRONG!)
Content-Length: 952\r\n
Content-Type: application/json\r\n
\r\n <-- Here is where the body starts
{"json-body":...}
Diffstat (limited to 'src/restRequest.py')
0 files changed, 0 insertions, 0 deletions