1
0
Fork 0
mirror of https://codeberg.org/tyy/aspm synced 2024-12-22 15:59:29 -07:00

Fix all post requests being rejected

This commit is contained in:
Tyler Beckman 2024-07-11 23:29:21 -06:00
parent 0a877d639b
commit 0c5452a1b8
Signed by: Ty
GPG key ID: 2813440C772555A4

View file

@ -124,7 +124,7 @@ async fn post_request(
data: String,
content_type: web::Header<header::ContentType>,
) -> impl Responder {
if content_type.to_string().as_str() != "application/asp+jwt; charset=UTF-8" {
if content_type.to_string().as_str() != "application/asp+jwt; charset=utf-8" {
return HttpResponse::BadRequest()
.body("Content type header was not set to \"application/asp+jwt; charset=UTF-8\"");
}
@ -135,7 +135,7 @@ async fn post_request(
| AspeRequestVariant::Delete { aspe_uri } = &request.request
{
if aspe_uri != &format!("aspe:{}:{}", &state.domain, &key.fingerprint) {
return HttpResponse::BadRequest().finish();
return HttpResponse::BadRequest().body("ASPE uri did not match key and domain");
}
}