Skip to content

Commit

Permalink
Handle nonexisting realm path as 404
Browse files Browse the repository at this point in the history
  • Loading branch information
oliwel committed Dec 9, 2020
1 parent dc2509e commit 4145ee8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions core/i18n/de_DE/openxpki.po
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,9 @@ msgstr "Kann keinen Schlüssel ohne Passwort erstellen"
msgid "I18N_OPENXPKI_UI_NO"
msgstr "Nein"

msgid "I18N_OPENXPKI_UI_NO_SUCH_REALM_OR_SERVICE"
msgstr "Unter dieser Adresse ist keine Service eingerichtet."

# Remove?
msgid "I18N_OPENXPKI_UI_OOPS"
msgstr "Oops, hier ist etwas schief gegangen"
Expand Down
3 changes: 3 additions & 0 deletions core/i18n/en_US/openxpki.po
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,9 @@ msgstr "Unable to generate a key without a password"
msgid "I18N_OPENXPKI_UI_NO"
msgstr "No"

msgid "I18N_OPENXPKI_UI_NO_SUCH_REALM_OR_SERVICE"
msgstr "The requested URL has no service assigned."

msgid "I18N_OPENXPKI_UI_OOPS"
msgstr "Oops, something went wrong"

Expand Down
7 changes: 5 additions & 2 deletions core/server/cgi-bin/webui.fcgi
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,11 @@ while (my $cgi = CGI::Fast->new()) {
if ($script_path =~ qq|\/([^\/]+)\$|) {
$script_realm = $1;
if (!$config{realm}{$script_realm}) {
$log->fatal('No realm for ident: ' . $script_realm );
die "Url based realm requested but no realm found for $script_realm!";
$log->debug('No realm for ident: ' . $script_realm );
__handle_error($cgi, 'I18N_OPENXPKI_UI_NO_SUCH_REALM_OR_SERVICE');
$session_front->flush();
$backend_client->detach();
next;
}
$log->debug('detected realm is ' . $config{realm}{$script_realm});

Expand Down

0 comments on commit 4145ee8

Please sign in to comment.