Add server config for mergable extensions
This commit is contained in:
parent
7008c54e2e
commit
c3cbde052a
16 changed files with 214 additions and 71 deletions
|
|
@ -33,5 +33,6 @@ pub async fn ping(
|
|||
Ok(Json(PingResponse {
|
||||
server_version: env!("CARGO_PKG_VERSION").to_owned(),
|
||||
is_authenticated,
|
||||
mergeable_file_extensions: state.config.server.mergeable_file_extensions.clone(),
|
||||
}))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ pub struct PingResponse {
|
|||
/// Whether the client is authenticated based on the sent Authorization
|
||||
/// header.
|
||||
pub is_authenticated: bool,
|
||||
|
||||
/// List of file extensions that are allowed to be merged.
|
||||
pub mergeable_file_extensions: Vec<String>,
|
||||
}
|
||||
|
||||
/// Response to a fetch latest documents request.
|
||||
|
|
|
|||
|
|
@ -185,8 +185,10 @@ async fn update_document(
|
|||
)));
|
||||
}
|
||||
|
||||
let are_all_participants_mergable = is_file_type_mergable(&sanitized_relative_path)
|
||||
&& !is_binary(&parent_document.content)
|
||||
let are_all_participants_mergable = is_file_type_mergable(
|
||||
&sanitized_relative_path,
|
||||
&state.config.server.mergeable_file_extensions,
|
||||
) && !is_binary(&parent_document.content)
|
||||
&& !is_binary(&latest_version.content)
|
||||
&& !is_binary(&content);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue