Set cache control to no-cache for all api endpoints, logging access keys instead of captcha keys
This commit is contained in:
parent
a2292ffc68
commit
2e600cc6d2
1 changed files with 5 additions and 1 deletions
|
@ -41,7 +41,7 @@ async fn main() -> std::io::Result<()> {
|
|||
|
||||
for _ in 0..10 {
|
||||
let s = hex_string(10);
|
||||
info!("Adding captcha key: {}", &s);
|
||||
info!("Adding access key: {}", &s);
|
||||
capt_db.capthca_db.lock().unwrap().insert(s);
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,10 @@ async fn main() -> std::io::Result<()> {
|
|||
)
|
||||
.service(
|
||||
scope("/api")
|
||||
.wrap(
|
||||
middleware::DefaultHeaders::new()
|
||||
.add(CacheControl(vec![CacheDirective::NoCache])),
|
||||
)
|
||||
.service(get_posts)
|
||||
.service(new_post)
|
||||
.service(delete_post)
|
||||
|
|
Loading…
Reference in a new issue