mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2026-01-30 19:15:17 +01:00
Compare commits
4 Commits
develop
...
release-pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43e58bbb87 | ||
|
|
7092800159 | ||
|
|
285e5e4c51 | ||
|
|
c74ef58c25 |
Submodule libs/drop-base updated: 14f4e3e20b...04125e89be
@@ -6,7 +6,7 @@ use std::{
|
|||||||
use keyring::Entry;
|
use keyring::Entry;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
use crate::interface::{DatabaseInterface};
|
use crate::interface::DatabaseInterface;
|
||||||
|
|
||||||
pub static DB: LazyLock<DatabaseInterface> = LazyLock::new(DatabaseInterface::set_up_database);
|
pub static DB: LazyLock<DatabaseInterface> = LazyLock::new(DatabaseInterface::set_up_database);
|
||||||
|
|
||||||
@@ -32,6 +32,9 @@ pub(crate) static KEY_IV: LazyLock<([u8; 16], [u8; 16])> = LazyLock::new(|| {
|
|||||||
info!("created new database key");
|
info!("created new database key");
|
||||||
buffer.to_vec()
|
buffer.to_vec()
|
||||||
});
|
});
|
||||||
let new = key.split_off(16);
|
let iv: Vec<u8> = key.split_off(16);
|
||||||
(new.try_into().expect("failed to extract key"), key.try_into().expect("failed to extract iv"))
|
(
|
||||||
});
|
key[0..16].try_into().expect("key wrong length"),
|
||||||
|
iv[0..16].try_into().expect("iv wrong length"),
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|||||||
@@ -453,7 +453,7 @@ impl ProcessManager<'_> {
|
|||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
let mut command = Command::new("cmd");
|
let mut command = Command::new("cmd");
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
command.raw_arg(format!("/C \"{}\"", &launch_string));
|
command.raw_arg(format!("/C \"{}\"", &launch_parameters.0));
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
"launching (in {}): {}",
|
"launching (in {}): {}",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use database::borrow_db_checked;
|
use database::borrow_db_checked;
|
||||||
use http::{
|
use http::{
|
||||||
HeaderMap, HeaderValue, Request, Response, StatusCode, Uri, header::USER_AGENT,
|
HeaderMap, HeaderValue, Request, Response, StatusCode, Uri, header::{CONTENT_SECURITY_POLICY, USER_AGENT, X_FRAME_OPTIONS},
|
||||||
};
|
};
|
||||||
use log::{error, warn};
|
use log::{error, warn};
|
||||||
use tauri::UriSchemeResponder;
|
use tauri::UriSchemeResponder;
|
||||||
@@ -30,7 +30,7 @@ pub async fn handle_server_proto_wrapper(request: Request<Vec<u8>>, responder: U
|
|||||||
match handle_server_proto(request).await {
|
match handle_server_proto(request).await {
|
||||||
Ok(r) => responder.respond(r),
|
Ok(r) => responder.respond(r),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!("Cache error: {e}");
|
warn!("server proto error: {e}");
|
||||||
responder.respond(
|
responder.respond(
|
||||||
Response::builder()
|
Response::builder()
|
||||||
.status(e)
|
.status(e)
|
||||||
@@ -84,12 +84,13 @@ async fn handle_server_proto(request: Request<Vec<u8>>) -> Result<Response<Vec<u
|
|||||||
let response = match DROP_CLIENT_ASYNC
|
let response = match DROP_CLIENT_ASYNC
|
||||||
.request(request.method().clone(), new_uri.to_string())
|
.request(request.method().clone(), new_uri.to_string())
|
||||||
.headers(headers)
|
.headers(headers)
|
||||||
|
.body(request.body().clone()) // TODO: refactor this into a move
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(response) => response,
|
Ok(response) => response,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!("Could not send response. Got {e} when sending");
|
warn!("Could not send response. Got {e:?} when sending");
|
||||||
return Err(e.status().unwrap_or(StatusCode::BAD_REQUEST));
|
return Err(e.status().unwrap_or(StatusCode::BAD_REQUEST));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -102,6 +103,12 @@ async fn handle_server_proto(request: Request<Vec<u8>>) -> Result<Response<Vec<u
|
|||||||
{
|
{
|
||||||
let client_response_headers = client_http_response.headers_mut().unwrap();
|
let client_response_headers = client_http_response.headers_mut().unwrap();
|
||||||
for (header, header_value) in response.headers() {
|
for (header, header_value) in response.headers() {
|
||||||
|
if header == CONTENT_SECURITY_POLICY {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if header == X_FRAME_OPTIONS {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
client_response_headers.insert(header, header_value.clone());
|
client_response_headers.insert(header, header_value.clone());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user