]> git.tdb.fi Git - libs/net.git/blobdiff - source/request.cpp
Use maputils.h
[libs/net.git] / source / request.cpp
index ba47c4dcb4295a07b6d8b05cfc8f7d2a56e3a753..c948755ae78281cb1c36378de491a1cd0c948cd7 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmsphttp
-Copyright © 2008  Mikkosoft Productions, Mikko Rasa
-Distributed under the LGPL
-*/
-
 #include <msp/strings/formatter.h>
 #include <msp/strings/regex.h>
 #include <msp/strings/utils.h>
@@ -34,7 +27,7 @@ Request Request::parse(const string &str)
        unsigned lf = str.find('\n');
        vector<string> parts = split(str.substr(0, lf-(str[lf-1]=='\r')), ' ', 2);
        if(parts.size()<3)
-               throw InvalidParameterValue("Invalid request");
+               throw invalid_argument("Request::parse");
 
        Request result(parts[0], parts[1]);
        result.http_version = parse_version(parts[2]);
@@ -50,7 +43,8 @@ Request Request::from_url(const string &str)
 {
        Url url = parse_url(str);
        if(url.scheme!="http")
-               throw InvalidParameterValue("Only http scheme is supported");
+               throw invalid_argument("Request::from_url");
+
        string path = url.path;
        if(path.empty())
                path = "/";