Fixed another issue with ContentType & HeaderParam constructors doing parsing

This commit is contained in:
Sylvain Berfini 2018-03-21 16:09:36 +01:00
parent 57b07c4545
commit 5fd6a68b94
2 changed files with 2 additions and 2 deletions

View file

@ -75,7 +75,7 @@ ContentType::ContentType (const string &contentType) : ClonableObject(*new Conte
string token;
do {
posParam = params.find(";");
if (posParam != string::npos) {
if (posParam == string::npos) {
token = params;
} else {
token = params.substr(0, posParam);

View file

@ -46,7 +46,7 @@ HeaderParam::HeaderParam (const string &param) : ClonableObject(*new HeaderParam
setName(param);
} else {
setName(param.substr(0, pos));
setValue(param.substr(pos + 1, end));
setValue(param.substr(pos + 1, end - (pos + 1)));
}
}