Skip to content

Commit cb12c34

Browse files
author
Arun Gopalpuri
committed
adding decompress middleware
1 parent bb63adc commit cb12c34

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
+++
2+
title = "Decompress Middleware"
3+
description = "Decompress middleware for Echo"
4+
[menu.main]
5+
name = "Decompress"
6+
parent = "middleware"
7+
+++
8+
9+
Decompress middleware decompresses HTTP request if Content-Encoding header is set to gzip.
10+
11+
*Usage*
12+
13+
`e.Use(middleware.Decompress())`
14+
15+
## Custom Configuration
16+
17+
*Usage*
18+
19+
```go
20+
e := echo.New()
21+
e.Use(middleware.DecompressWithConfig(middleware.DecompressConfig{
22+
Skipper: Skipper
23+
}))
24+
```
25+
26+
## Configuration
27+
28+
```go
29+
DecompressConfig struct {
30+
// Skipper defines a function to skip middleware.
31+
Skipper Skipper
32+
}
33+
```
34+
35+
*Default Configuration*
36+
37+
```go
38+
DefaultDecompressConfig = DecompressConfig{
39+
Skipper: DefaultSkipper,
40+
}
41+
```

0 commit comments

Comments
 (0)