MCPcopy
hub / github.com/CesiumGS/cesium / checkGzipAndNext

Function checkGzipAndNext

server.js:188–205  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

186 });
187
188 function checkGzipAndNext(req, res, next) {
189 const baseURL = `${req.protocol}://${req.headers.host}/`;
190 const reqUrl = new URL(req.url, baseURL);
191 const filePath = reqUrl.pathname.substring(1);
192
193 const readStream = fs.createReadStream(filePath, { start: 0, end: 2 });
194 //eslint-disable-next-line no-unused-vars
195 readStream.on("error", function (err) {
196 next();
197 });
198
199 readStream.on("data", function (chunk) {
200 if (chunk.equals(gzipHeader)) {
201 res.header("Content-Encoding", "gzip");
202 }
203 next();
204 });
205 }
206
207 const knownTilesetFormats = [
208 /\.b3dm/,

Callers

nothing calls this directly

Calls 2

nextFunction · 0.50
equalsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…