mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
test undefined Accept-Encoding with head request
This commit is contained in:
parent
04bb2a9f8f
commit
a4639fa638
1 changed files with 20 additions and 4 deletions
|
@ -76,10 +76,19 @@ describe(__filename, function () {
|
||||||
assert.match(res.header['content-type'], /application\/javascript/);
|
assert.match(res.header['content-type'], /application\/javascript/);
|
||||||
assert.equal(res.header['content-encoding'], undefined);
|
assert.equal(res.header['content-encoding'], undefined);
|
||||||
assert.equal(isPlaintextResponse(res.text, resource), true);
|
assert.equal(isPlaintextResponse(res.text, resource), true);
|
||||||
return;
|
|
||||||
})));
|
})));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// need to use head here - cant unset Accept-Encoding in GET requests
|
||||||
|
it('head request without Accept-Encoding header does not set Content-Encoding', async function () {
|
||||||
|
await agent
|
||||||
|
.head(packages[0])
|
||||||
|
.then((res) => {
|
||||||
|
assert.match(res.header['content-type'], /application\/javascript/);
|
||||||
|
assert.equal(res.header['content-encoding'], undefined);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('gets packages compressed with Accept-Encoding gzip', async function () {
|
it('gets packages compressed with Accept-Encoding gzip', async function () {
|
||||||
await Promise.all(packages.map(async (resource) => await agent.get(resource)
|
await Promise.all(packages.map(async (resource) => await agent.get(resource)
|
||||||
.set('Accept-Encoding', 'gzip')
|
.set('Accept-Encoding', 'gzip')
|
||||||
|
@ -88,7 +97,6 @@ describe(__filename, function () {
|
||||||
assert.match(res.header['content-type'], /application\/javascript/);
|
assert.match(res.header['content-type'], /application\/javascript/);
|
||||||
assert.equal(res.header['content-encoding'], 'gzip');
|
assert.equal(res.header['content-encoding'], 'gzip');
|
||||||
assert.equal(isPlaintextResponse(res.text, resource), false);
|
assert.equal(isPlaintextResponse(res.text, resource), false);
|
||||||
return;
|
|
||||||
})));
|
})));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -126,10 +134,19 @@ describe(__filename, function () {
|
||||||
assert.match(res.header['content-type'], /application\/javascript/);
|
assert.match(res.header['content-type'], /application\/javascript/);
|
||||||
assert.equal(res.header['content-encoding'], undefined);
|
assert.equal(res.header['content-encoding'], undefined);
|
||||||
assert.equal(isPlaintextResponse(res.text, resource), true);
|
assert.equal(isPlaintextResponse(res.text, resource), true);
|
||||||
return;
|
|
||||||
})));
|
})));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// need to use head here - cant unset Accept-Encoding in GET requests
|
||||||
|
it('head request without Accept-Encoding header does not set Content-Encoding', async function () {
|
||||||
|
await agent
|
||||||
|
.head(packages[0])
|
||||||
|
.then((res) => {
|
||||||
|
assert.match(res.header['content-type'], /application\/javascript/);
|
||||||
|
assert.equal(res.header['content-encoding'], undefined);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('gets packages compressed with Accept-Encoding gzip', async function () {
|
it('gets packages compressed with Accept-Encoding gzip', async function () {
|
||||||
await Promise.all(packages.map(async (resource) => await agent.get(resource)
|
await Promise.all(packages.map(async (resource) => await agent.get(resource)
|
||||||
.set('Accept-Encoding', 'gzip')
|
.set('Accept-Encoding', 'gzip')
|
||||||
|
@ -138,7 +155,6 @@ describe(__filename, function () {
|
||||||
assert.match(res.header['content-type'], /application\/javascript/);
|
assert.match(res.header['content-type'], /application\/javascript/);
|
||||||
assert.equal(res.header['content-encoding'], 'gzip');
|
assert.equal(res.header['content-encoding'], 'gzip');
|
||||||
assert.equal(isPlaintextResponse(res.text, resource), false);
|
assert.equal(isPlaintextResponse(res.text, resource), false);
|
||||||
return;
|
|
||||||
})));
|
})));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue