format main.rs
This commit is contained in:
@@ -78,7 +78,14 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[get("/create?<url>&<secret>&<length>&<link>&<ttl>")]
|
#[get("/create?<url>&<secret>&<length>&<link>&<ttl>")]
|
||||||
async fn create(state: &State<Mutex<GlobalState>>, url: &str, secret: Option<&str>, length: Option<u32>, link: Option<&str>, ttl: Option<u64>) -> (Status, String) {
|
async fn create(
|
||||||
|
state: &State<Arc<Mutex<GlobalState>>>,
|
||||||
|
url: &str,
|
||||||
|
secret: Option<&str>,
|
||||||
|
length: Option<u32>,
|
||||||
|
link: Option<&str>,
|
||||||
|
ttl: Option<u64>,
|
||||||
|
) -> (Status, String) {
|
||||||
let mut allow_secret_options = false;
|
let mut allow_secret_options = false;
|
||||||
if let Some(secret) = secret {
|
if let Some(secret) = secret {
|
||||||
if secret == include_str!("../secret.txt").trim() {
|
if secret == include_str!("../secret.txt").trim() {
|
||||||
|
|||||||
Reference in New Issue
Block a user