|
| 1 | +brotli |
| 2 | +==== |
| 3 | + |
| 4 | +This is a simple [dgoss] test to validate that the brotli module is running. |
| 5 | + |
| 6 | +To test: |
| 7 | + |
| 8 | +1. cd `tests/brotli` |
| 9 | +1. Run `make dgoss` |
| 10 | + |
| 11 | +Behind the scenes, it builds the `brotli`-enabled docker image, then builds |
| 12 | +a test image. |
| 13 | + |
| 14 | +Finally, it runs `dgoss` and passes in `Accept-Encoding: gzip, deflate, br` |
| 15 | +as part of the request. |
| 16 | + |
| 17 | +Here's a sample curl request when `SERVER_ENABLE_NGX_BROTLI=true`: |
| 18 | + |
| 19 | +```shell |
| 20 | +$ curl http://localhost:8080/ -v -H "Accept-Encoding: gzip, deflate, br" |
| 21 | +* Trying ::1... |
| 22 | +* TCP_NODELAY set |
| 23 | +* Connected to localhost (::1) port 8083 (#0) |
| 24 | +> GET / HTTP/1.1 |
| 25 | +> Host: localhost:8080 |
| 26 | +> User-Agent: curl/7.64.1 |
| 27 | +> Accept: */* |
| 28 | +> Accept-Encoding: gzip, deflate, br |
| 29 | +> |
| 30 | +< HTTP/1.1 200 OK |
| 31 | +< Server: nginx |
| 32 | +< Date: Wed, 17 Aug 2022 21:41:21 GMT |
| 33 | +< Content-Type: text/html |
| 34 | +< Last-Modified: Wed, 17 Aug 2022 17:59:04 GMT |
| 35 | +< Transfer-Encoding: chunked |
| 36 | +< Connection: keep-alive |
| 37 | +< ETag: W/"62fd2c68-279" |
| 38 | +< X-XSS-Protection: 1; mode=block |
| 39 | +< X-Content-Type-Options: nosniff |
| 40 | +< Content-Encoding: br |
| 41 | +< |
| 42 | +Warning: Binary output can mess up your terminal. Use "--output -" to tell |
| 43 | +Warning: curl to output it to your terminal anyway, or consider "--output |
| 44 | +Warning: <FILE>" to save to a file. |
| 45 | +* Failed writing body (0 != 299) |
| 46 | +* Failed writing data |
| 47 | +* Closing connection 0 |
| 48 | +``` |
| 49 | +
|
| 50 | +The script assumes that you have `dgoss` installed. |
| 51 | +
|
| 52 | +[dgoss]: https://github.com/aelsabbahy/goss/blob/master/extras/dgoss/README.md |
0 commit comments