http-response https?://****** script-path=./scripts/demo
demo.js,requires-body=true,max-size=-1
demo.js:
let body = $response.body
$done({body})
执行完脚本后第三方App就异常了,好像是该App强制ungzip了。这脚本在其他App测试是没问题的。
未执行脚本返回的response header
HTTP/1.1 200 OK
Server: Tengine
Content-Type: application/json; charset=utf-8
Content-Length: 1136
Connection: keep-alive
Date: Mon, 13 Jul 2020 03:47:40 GMT
X-Powered-By: PHP/5.5.9-1ubuntu4.29
Vary: Accept-Encoding
Content-Encoding: gzip
Ali-Swift-Global-Savetime: 1594612060
Via: cache1.l2st3-1[52,200-0,M], cache2.l2st3-1[53,0], cache2.cn724[58,200-0,M], cache10.cn724[58,0]
X-Cache: MISS TCP_MISS dirn:-2:-2
X-Swift-SaveTime: Mon, 13 Jul 2020 03:47:40 GMT
X-Swift-CacheTime: 0
Timing-Allow-Origin: *
EagleId: 674e7fa015946120608016559e
执行脚本后返回的response header
HTTP/1.1 200 OK
Server: Tengine
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Date: Mon, 13 Jul 2020 03:50:08 GMT
X-Powered-By: PHP/5.5.9-1ubuntu4.29
Vary: Accept-Encoding
Ali-Swift-Global-Savetime: 1594612208
Via: cache1.l2st3-1[65,200-0,M], cache39.l2st3-1[66,0], cache2.cn724[68,200-0,M], cache1.cn724[70,0]
X-Cache: MISS TCP_MISS dirn:-2:-2
X-Swift-SaveTime: Mon, 13 Jul 2020 03:50:08 GMT
X-Swift-CacheTime: 0
Timing-Allow-Origin: *
EagleId: 674e7f9715946122080812663e
Transfer-Encoding: identity
Content-Encoding: identity
Content-Length: 6048
不知道有什么方法解决这问题。Surge是否能支持设置content-encoding为gzip并实现gzip?比如:
http-response https?://****** script-path=./scripts/demo
demo.js,requires-body=true,max-size=-1,
content-encoding =gzip