Remove file extensions from digests.

Gravatar supports file extensions, so we might come across them.
This commit is contained in:
tastytea 2018-11-27 04:22:21 +01:00
parent 13a71f0315
commit ed83a9c4a8
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.2) cmake_minimum_required (VERSION 3.2)
project(libravatarserv project(libravatarserv
VERSION 0.3.1 VERSION 0.3.2
LANGUAGES CXX LANGUAGES CXX
) )

View File

@ -42,6 +42,11 @@ const Request http::parse_request(const string &request)
if (pos_digest != std::string::npos) if (pos_digest != std::string::npos)
{ {
digest = digest.substr(0, pos_digest); digest = digest.substr(0, pos_digest);
pos_digest = digest.find('.');
if (pos_digest != std::string::npos)
{
digest = digest.substr(0, pos_digest);
}
string answer; string answer;
{ {