Skip to content

Commit 0efd8a3

Browse files
authored
Merge pull request #2 from hcarty/fix-gzip
Fix zlib formatting in gzip (de)compression
2 parents 3885042 + 46442fc commit 0efd8a3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v0.2.1
2+
* Fix zlib formatting in gzip (de)compression
3+
14
# v0.2.0
25
* Use `Zlib` from camlzip rather than cryptokit + crc
36
* Allow capping the size of decompressed content

src/ezgzip.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module Z = struct
4646

4747
let error e = R.error (`Zlib e)
4848

49-
let compress_zlib ?level ?header input output =
49+
let compress_zlib ?level ?(header= false) input output =
5050
let pos = ref 0 in
5151
let length = String.length input in
5252
let feed buf =
@@ -55,10 +55,10 @@ module Z = struct
5555
pos := !pos + bytes ;
5656
bytes
5757
in
58-
Zlib.compress ?level ?header feed output
58+
Zlib.compress ?level ~header feed output
5959

6060

61-
let uncompress_zlib ?header input output =
61+
let uncompress_zlib ?(header= false) input output =
6262
let pos = ref 0 in
6363
let length = String.length input in
6464
let feed buf =
@@ -67,7 +67,7 @@ module Z = struct
6767
pos := !pos + bytes ;
6868
bytes
6969
in
70-
Zlib.uncompress ?header feed output
70+
Zlib.uncompress ~header feed output
7171

7272

7373
let compress ?level ?header input =

0 commit comments

Comments
 (0)