From ed83a9c4a8b5804ea63b7c60b9f482f90de20a36 Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 27 Nov 2018 04:22:21 +0100 Subject: [PATCH] Remove file extensions from digests. Gravatar supports file extensions, so we might come across them. --- CMakeLists.txt | 2 +- src/http.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea555bc..e584d7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.2) project(libravatarserv - VERSION 0.3.1 + VERSION 0.3.2 LANGUAGES CXX ) diff --git a/src/http.cpp b/src/http.cpp index b6916bb..9e3a1bb 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -42,6 +42,11 @@ 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; {