Browse Source

Return 501 or redirect if "Mystery Person" is not found.

tastytea 5 days ago
parent
commit
9aa8803029
Signed by: tastytea <tastytea@tastytea.de> GPG Key ID: CFC39497F1B26E07
2 changed files with 5 additions and 3 deletions
  1. 1
    1
      CMakeLists.txt
  2. 4
    2
      src/libravatarserv.cpp

+ 1
- 1
CMakeLists.txt View File

@@ -1,6 +1,6 @@
1 1
 cmake_minimum_required (VERSION 3.2)
2 2
 project(libravatarserv
3
-        VERSION 0.6.6
3
+        VERSION 0.6.7
4 4
         LANGUAGES CXX
5 5
 )
6 6
 

+ 4
- 2
src/libravatarserv.cpp View File

@@ -25,7 +25,7 @@ using std::endl;
25 25
 
26 26
 // Global variables
27 27
 std::map<const string, const string> hash::table;
28
-fs::path settings::avatar_dir = "";
28
+fs::path settings::avatar_dir;
29 29
 settings::Settings settings::settings;
30 30
 
31 31
 int main()
@@ -96,8 +96,9 @@ int main()
96 96
             }
97 97
             else
98 98
             {
99
-                cout << "Status: 404 Not Found\n\n";
100 99
                 cerr << "Error: Mystery person not found.\n";
100
+                // Jump to last else
101
+                goto not_implemented;
101 102
             }
102 103
         }
103 104
         else if (avatar.fallback.substr(0, 9) == "identicon")
@@ -116,6 +117,7 @@ int main()
116 117
         }
117 118
         else
118 119
         {
120
+            not_implemented:
119 121
             if (settings::settings.redirect_nofallback)
120 122
             {
121 123
                 http::send_redirect(avatar);

Loading…
Cancel
Save