Accepts ad with no pubkey
This commit is contained in:
parent
59c69765d7
commit
6a70bfc032
|
@ -121,8 +121,7 @@ pub async fn start_server(
|
||||||
.and(warp::get())
|
.and(warp::get())
|
||||||
.and(warp::fs::dir(opt.dir.0.join(static_files::STATIC_DIR)));
|
.and(warp::fs::dir(opt.dir.0.join(static_files::STATIC_DIR)));
|
||||||
|
|
||||||
let handle_new_ad =
|
let handle_new_ad = {
|
||||||
{
|
|
||||||
let handle_index = handle_index.clone();
|
let handle_index = handle_index.clone();
|
||||||
let dbs = dbs.clone();
|
let dbs = dbs.clone();
|
||||||
let cache_ads = cache_ads.clone();
|
let cache_ads = cache_ads.clone();
|
||||||
|
@ -136,13 +135,17 @@ pub async fn start_server(
|
||||||
author: query.author,
|
author: query.author,
|
||||||
password: hasher.finalize()[..].try_into().unwrap(),
|
password: hasher.finalize()[..].try_into().unwrap(),
|
||||||
price: query.price,
|
price: query.price,
|
||||||
pubkey: (!query.pubkey.is_empty()).then_some(match format_pubkey(&query.pubkey) {
|
pubkey: if query.pubkey.is_empty() {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(match format_pubkey(&query.pubkey) {
|
||||||
Ok(pubkey) => pubkey,
|
Ok(pubkey) => pubkey,
|
||||||
Err(e) => return handle_index(&[ErrorTemplate{text: match e {
|
Err(e) => return handle_index(&[ErrorTemplate{text: match e {
|
||||||
PubkeyDecodeError::BadChecksum => "La somme de contrôle de la clé publique est incorrecte.",
|
PubkeyDecodeError::BadChecksum => "La somme de contrôle de la clé publique est incorrecte.",
|
||||||
PubkeyDecodeError::BadFormat => "Le format de la clé publique est incorrect.",
|
PubkeyDecodeError::BadFormat => "Le format de la clé publique est incorrect.",
|
||||||
}}])
|
}}])
|
||||||
}),
|
})
|
||||||
|
},
|
||||||
quantity: query.quantity,
|
quantity: query.quantity,
|
||||||
time: 0,
|
time: 0,
|
||||||
title: query.title,
|
title: query.title,
|
||||||
|
|
Loading…
Reference in New Issue