Skip to content

Commit

Permalink
Make the extension comparison to strict
Browse files Browse the repository at this point in the history
  • Loading branch information
sorairolake committed Apr 8, 2024
1 parent 699b325 commit 82a374e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lzip.go
Expand Up @@ -3,6 +3,7 @@ package archiver
import (
"bytes"
"io"
"path/filepath"
"strings"

"github.com/sorairolake/lzip-go"
Expand All @@ -21,7 +22,7 @@ func (lz Lzip) Match(filename string, stream io.Reader) (MatchResult, error) {
var mr MatchResult

// match filename
if strings.Contains(strings.ToLower(filename), lz.Name()) {
if filepath.Ext(strings.ToLower(filename)) == lz.Name() {
mr.ByName = true
}

Expand Down

0 comments on commit 82a374e

Please sign in to comment.