comparison Core/HttpServer/MongooseServer.cpp @ 809:8ce2f69436ca

do not return strings with base64
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 07 May 2014 16:39:53 +0200
parents b8c49473be38
children a811bdf8b8eb
comparison
equal deleted inserted replaced
808:2d9a000aa3a6 809:8ce2f69436ca
472 { 472 {
473 return ""; 473 return "";
474 } 474 }
475 475
476 std::string b64 = s.substr(6); 476 std::string b64 = s.substr(6);
477 std::string decoded = Toolbox::DecodeBase64(b64); 477 std::string decoded;
478 Toolbox::DecodeBase64(decoded, b64);
478 size_t semicolons = decoded.find(':'); 479 size_t semicolons = decoded.find(':');
479 480
480 if (semicolons == std::string::npos) 481 if (semicolons == std::string::npos)
481 { 482 {
482 // Bad-formatted request 483 // Bad-formatted request
847 const char* password) 848 const char* password)
848 { 849 {
849 Stop(); 850 Stop();
850 851
851 std::string tag = std::string(username) + ":" + std::string(password); 852 std::string tag = std::string(username) + ":" + std::string(password);
852 registeredUsers_.insert(Toolbox::EncodeBase64(tag)); 853 std::string encoded;
854 Toolbox::EncodeBase64(encoded, tag);
855 registeredUsers_.insert(encoded);
853 } 856 }
854 857
855 void MongooseServer::SetSslEnabled(bool enabled) 858 void MongooseServer::SetSslEnabled(bool enabled)
856 { 859 {
857 Stop(); 860 Stop();