Skip to content

Commit

Permalink
Merge pull request #297 from sohosai/develop
Browse files Browse the repository at this point in the history
deploy 20240511
  • Loading branch information
arata-nvm authored May 10, 2024
2 parents 420a310 + e44a46d commit 8cb5e2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions crates/sos24-domain/src/entity/file_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ impl_value_object!(FileId(uuid::Uuid));
pub struct FileName(String);

impl FileName {
pub fn new(name: String) -> Self {
Self(name)
}

pub fn sanitized(name: String) -> Self {
// ref: https://github.com/rwf2/Rocket/blob/60f3cd57b06243beaee87fd5b7545e3bf0fa6f60/core/lib/src/fs/file_name.rs#L140-L146
static BAD_CHARS: &[char] = &[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl<R: Repositories> FileUseCase<R> {
);
file_list.push(ArchiveEntry::new(
file.url,
FileName::sanitized(filename),
FileName::new(filename), // FIXME: ファイル名のサニタイズ
file.updated_at,
));
}
Expand Down

0 comments on commit 8cb5e2b

Please sign in to comment.