MCPcopy Create free account
hub / github.com/cambecc/earth / compressionFilter

Function compressionFilter

dev-server.js:15–17  ·  view source on GitHub ↗

* Returns true if the response should be compressed.

(req, res)

Source from the content-addressed store, hash-verified

13 * Returns true if the response should be compressed.
14 */
15function compressionFilter(req, res) {
16 return (/json|text|javascript|font/).test(res.getHeader('Content-Type'));
17}
18
19/**
20 * Adds headers to a response to enable caching.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected