Bugfix: Remove file extensions from digest with no parameters in URL

This commit is contained in:
tastytea 2018-11-27 04:50:03 +01:00
parent 43232d802b
commit f793a86af2
Signed by untrusted user: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 9 additions and 8 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.2)
project(libravatarserv
VERSION 0.4.0
VERSION 0.4.1
LANGUAGES CXX
)

View File

@ -41,13 +41,6 @@ const Request http::parse_request(const string &request)
if (pos_digest != std::string::npos)
{
digest = digest.substr(0, pos_digest);
pos_digest = digest.find('.');
if (pos_digest != std::string::npos)
{
digest = digest.substr(0, pos_digest);
}
string answer;
{
answer = get_parameter(request, "s");
@ -95,6 +88,14 @@ const Request http::parse_request(const string &request)
}
}
digest = digest.substr(0, pos_digest);
pos_digest = digest.find('.');
if (pos_digest != std::string::npos)
{
digest = digest.substr(0, pos_digest);
}
cerr << digest << std::endl;
return { digest, size, fallback };
}