Modify method of getting arguments

It may be inefficient, I dont know another way to do so easily.
This commit is contained in:
Ethan O'Brien
2024-07-10 22:24:18 -05:00
parent 680dc9d0fc
commit 88dfaed1a0
3 changed files with 8 additions and 12 deletions

View File

@ -7,8 +7,6 @@ use json::{object, JsonValue};
use hmac::{Hmac, Mac};
use rusqlite::params;
use lazy_static::lazy_static;
use std::sync::atomic::Ordering;
use std::sync::atomic::AtomicBool;
use openssl::pkey::PKey;
use openssl::rsa::Rsa;
@ -333,12 +331,9 @@ pub fn migration_password_register(req: HttpRequest, body: String) -> HttpRespon
send(req, resp)
}
lazy_static!{
pub static ref HTTPS: AtomicBool = AtomicBool::new(false);
}
pub fn get_protocol() -> String {
if HTTPS.load(Ordering::SeqCst) == true {
let args = crate::get_args();
if args.https == true {
return String::from("https");
}
String::from("http")