Skip to content
This repository was archived by the owner on Jun 12, 2018. It is now read-only.

Commit 50ce751

Browse files
dsirokyeidheim
authored andcommitted
remove locale dependent stof()
e.g. stof("1.1") might return 1.0 if the locale decimal delimiter is ","
1 parent de560e8 commit 50ce751

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

server_http.hpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -390,16 +390,6 @@ namespace SimpleWeb {
390390
if(timer)
391391
timer->cancel();
392392
if(!ec) {
393-
float http_version;
394-
try {
395-
http_version=stof(request->http_version);
396-
}
397-
catch(const std::exception &e){
398-
if(on_error)
399-
on_error(request, boost::system::error_code(boost::system::errc::protocol_error, boost::system::generic_category()));
400-
return;
401-
}
402-
403393
if (response->close_connection_after_response)
404394
return;
405395

@@ -408,7 +398,7 @@ namespace SimpleWeb {
408398
if(boost::iequals(it->second, "close"))
409399
return;
410400
}
411-
if(http_version>1.05)
401+
if(request->http_version >= "1.1")
412402
this->read_request_and_content(response->socket);
413403
}
414404
else if(on_error)

0 commit comments

Comments
 (0)