Skip to content

Commit

Permalink
chore: handle no mimetype at all
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Jun 6, 2024
1 parent 174418b commit 7982777
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,12 @@ impl RemoteAsset {
filestem.remove(0);
if filestem.contains('.') {
Ok(filestem)
} else if let Some(extension) =
RemoteAsset::extension(RemoteAsset::mimetype(headers, origin_path)?, origin_path)
{
Ok(format!("{filestem}.{extension}"))
} else if let Ok(mimetype) = RemoteAsset::mimetype(headers, origin_path) {
if let Some(extension) = RemoteAsset::extension(mimetype, origin_path) {
Ok(format!("{filestem}.{extension}"))
} else {
Ok(filestem)
}
} else {
Ok(filestem)
}
Expand Down

0 comments on commit 7982777

Please sign in to comment.