summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--icespider/core/ihttpRequest.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/icespider/core/ihttpRequest.cpp b/icespider/core/ihttpRequest.cpp
index 461fc9e..682640f 100644
--- a/icespider/core/ihttpRequest.cpp
+++ b/icespider/core/ihttpRequest.cpp
@@ -90,14 +90,13 @@ namespace IceSpider {
const auto paramName = upto(acceptHdr, "=", true);
const auto paramValue = upto(acceptHdr, ",;", false);
if (paramName.first == "q") {
- a.q = std::strtof(std::string(paramValue.first).c_str(), nullptr);
- if (a.q <= 0.0F || a.q > 1.0F) {
+ if (convert(paramValue.first, a.q); a.q <= 0.0F || a.q > 1.0F) {
throw Http400_BadRequest();
}
}
tc = paramValue.second;
}
- accepts.push_back(a);
+ accepts.emplace_back(a);
}
std::stable_sort(accepts.begin(), accepts.end(), [](const auto & a, const auto & b) {