MCPcopy
hub / github.com/http-party/http-server / shouldCompressGzip

Function shouldCompressGzip

lib/core/index.js:44–52  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

42
43// Check to see if we should try to compress a file with gzip.
44function shouldCompressGzip(req) {
45 const headers = req.headers;
46
47 return headers && headers['accept-encoding'] &&
48 headers['accept-encoding']
49 .split(',')
50 .some(el => ['*', 'compress', 'gzip', 'deflate'].indexOf(el.trim()) !== -1)
51 ;
52}
53
54function shouldCompressBrotli(req) {
55 const headers = req.headers;

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…