Skip to content

Commit ca7ed00

Browse files
committed
Fixed error when GET request and string value inside
1 parent 4a22200 commit ca7ed00

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server_http.hpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,15 @@ namespace SimpleWeb {
357357
if(!ec) {
358358
if(timeout_content>0)
359359
timer->cancel();
360-
auto http_version=stof(request->http_version);
360+
float http_version;
361+
try {
362+
http_version=stof(request->http_version);
363+
}
364+
catch(const std::exception &e){
365+
if(exception_handler)
366+
exception_handler(e);
367+
return;
368+
}
361369

362370
auto range=request->header.equal_range("Connection");
363371
for(auto it=range.first;it!=range.second;it++) {

0 commit comments

Comments
 (0)