Skip to content

Commit

Permalink
Add ZipHeader() method to ZipReaderFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasssadar committed Mar 13, 2019
1 parent 2f88165 commit 6258303
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions zipreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ func (zr *ZipReaderFile) Close() error {
return nil
}

// Get the file header from ZIP (can return nil with broken archives)
func (zr *ZipReaderFile) ZipHeader() *zip.FileHeader {
if zr.zipEntry != nil {
return &zr.zipEntry.FileHeader
}
return nil
}

// Closes this ZIP archive and all it's ZipReaderFile entries.
func (zr *ZipReader) Close() error {
if zr.zipFile == nil {
Expand Down

0 comments on commit 6258303

Please sign in to comment.