Compare commits

...

2 Commits

Author SHA1 Message Date
32d3d0955d fix(contact): ignore empty honeypot values even if String exists
All checks were successful
Publish Docker Images / build-and-publish (push) Successful in 11m3s
2026-02-04 12:45:20 +01:00
03bd411c18 fix(nix): remove unused self value 2026-02-04 12:23:51 +01:00
4 changed files with 16 additions and 8 deletions

View File

@@ -32,7 +32,6 @@
};
outputs = {
self,
nixpkgs,
flake-utils,
rust-overlay,
@@ -52,7 +51,7 @@
formatter = alejandra.defaultPackage.${system};
packages = import ./nix/package.nix {inherit pkgs rustPlatform;};
devShell = import ./nix/shell.nix {
inherit inputs pkgs self rustVersion;
inherit inputs pkgs rustVersion;
};
}
);

View File

@@ -1,7 +1,6 @@
{
inputs,
pkgs,
self,
rustVersion,
...
}:

View File

@@ -93,10 +93,14 @@ impl From<ValidationErrors> for ContactError {
return Self::ValidationNameError("backend.contact.errors.validation.name".to_owned());
}
if validator::ValidationErrors::has_error(&Err(value.clone()), "email") {
return Self::ValidationEmailError("backend.contact.errors.validation.email".to_owned());
return Self::ValidationEmailError(
"backend.contact.errors.validation.email".to_owned(),
);
}
if validator::ValidationErrors::has_error(&Err(value), "message") {
return Self::ValidationMessageError("backend.contact.errors.validation.message".to_owned());
return Self::ValidationMessageError(
"backend.contact.errors.validation.message".to_owned(),
);
}
Self::ValidationError("backend.contact.errors.validation.other".to_owned())
}
@@ -113,9 +117,13 @@ impl From<ContactError> for ContactResponse {
success: false,
message: match value {
ContactError::CouldNotParseRequestEmailAddress(_)
| ContactError::ValidationEmailError(_) => "backend.contact.errors.validation.email",
| ContactError::ValidationEmailError(_) => {
"backend.contact.errors.validation.email"
}
ContactError::ValidationNameError(_) => "backend.contact.errors.validation.name",
ContactError::ValidationMessageError(_) => "backend.contact.errors.validation.message",
ContactError::ValidationMessageError(_) => {
"backend.contact.errors.validation.message"
}
ContactError::CouldNotParseSettingsEmail(_)
| ContactError::FailedToBuildMessage(_)
| ContactError::CouldNotSendEmail(_)

View File

@@ -161,7 +161,9 @@ impl ContactApi {
remote_addr: Option<poem::web::Data<&poem::web::RemoteAddr>>,
) -> ContactApiResponse {
let body = body.0;
if body.honeypot.is_some() {
if let Some(ref honeypot) = body.honeypot
&& !honeypot.trim().is_empty()
{
tracing::event!(
target: "backend::contact",
tracing::Level::INFO,