]> git.tdb.fi Git - libs/net.git/blobdiff - source/http/request.cpp
Reject HTTP messages starting with a linefeed
[libs/net.git] / source / http / request.cpp
index 54b0beeaa9cb4f7e908f995a2d0d328bc1bf91a0..15056d60d9a7d82f32ad180ea819170ac4549086 100644 (file)
@@ -28,6 +28,8 @@ string Request::str() const
 Request Request::parse(const string &str)
 {
        string::size_type lf = str.find('\n');
+       if(lf==0)
+               throw invalid_argument("Request::parse");
        vector<string> parts = split(str.substr(0, lf-(str[lf-1]=='\r')), ' ', 2);
        if(parts.size()<3)
                throw invalid_argument("Request::parse");