Gracefully handle wrong capitalization of username
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2024-09-25 00:20:30 +02:00
parent 1b72c97f42
commit 534e5a9d3c
2 changed files with 10 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ class WebKeyDirectoryController < WellKnownController
# /.well-known/openpgpkey/hu/:hashed_username(.txt)
def show
@user = User.find_by(cn: params[:l])
@user = User.find_by(cn: params[:l].downcase)
if @user.nil? ||
@user.pgp_pubkey.empty? ||