developer knowledge guide - hanyong/note GitHub Wiki
开发者知识指南
2017-12-07
写作
XML 处理
HTTP
-
2017-12 HTTP 请求使用 gzip 压缩。
apache 可使用 SetInputFilter 配置 mod_deflate。 nginx 参考 Nginx与Gzip请求, 可使用 lua-nginx-module 和 lua-zlib。
local zlib = require "zlib" local encoding = ngx.req.get_headers()["Content-Encoding"] if encoding == "gzip" then local body = ngx.req.get_body_data() if body then local stream = zlib.inflate() ngx.req.set_body_data(stream(body)) end end ```