This commit is contained in:
Niels Andriesse 2021-04-27 14:20:36 +10:00
parent fd5ab9431a
commit 95bbb32e8e
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ pub async fn store_file(
base64_encoded_bytes: &str, auth_token: Option<String>, pool: &storage::DatabaseConnectionPool,
) -> Result<Response, Rejection> {
// It'd be nice to use the UUID crate for the file ID, but clients want an integer ID
let upper_bound = 2e53 as u64; // JS has trouble if we go higher than this
let upper_bound = 2u64.pow(53); // JS has trouble if we go higher than this
let id: u64 = thread_rng().gen_range(0..upper_bound);
let now = chrono::Utc::now().timestamp_nanos();
// Check authorization level if needed