@whatwg-node/server 0.9.37 → 0.9.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,7 @@ function useContentEncoding() {
|
|
|
8
8
|
onRequest({ request, setRequest, fetchAPI, endResponse }) {
|
|
9
9
|
if (request.body) {
|
|
10
10
|
const contentEncodingHeader = request.headers.get('content-encoding');
|
|
11
|
-
if (contentEncodingHeader) {
|
|
11
|
+
if (contentEncodingHeader && contentEncodingHeader !== 'none') {
|
|
12
12
|
const contentEncodings = contentEncodingHeader?.split(',');
|
|
13
13
|
if (!contentEncodings.every(encoding => (0, utils_js_1.getSupportedEncodings)().includes(encoding))) {
|
|
14
14
|
endResponse(new fetchAPI.Response(`Unsupported 'Content-Encoding': ${contentEncodingHeader}`, {
|
package/cjs/utils.js
CHANGED
|
@@ -522,7 +522,7 @@ function getSupportedEncodings() {
|
|
|
522
522
|
}
|
|
523
523
|
function handleResponseDecompression(response, ResponseCtor) {
|
|
524
524
|
const contentEncodingHeader = response?.headers.get('content-encoding');
|
|
525
|
-
if (!contentEncodingHeader) {
|
|
525
|
+
if (!contentEncodingHeader || contentEncodingHeader === 'none') {
|
|
526
526
|
return response;
|
|
527
527
|
}
|
|
528
528
|
if (!response?.body) {
|
|
@@ -5,7 +5,7 @@ export function useContentEncoding() {
|
|
|
5
5
|
onRequest({ request, setRequest, fetchAPI, endResponse }) {
|
|
6
6
|
if (request.body) {
|
|
7
7
|
const contentEncodingHeader = request.headers.get('content-encoding');
|
|
8
|
-
if (contentEncodingHeader) {
|
|
8
|
+
if (contentEncodingHeader && contentEncodingHeader !== 'none') {
|
|
9
9
|
const contentEncodings = contentEncodingHeader?.split(',');
|
|
10
10
|
if (!contentEncodings.every(encoding => getSupportedEncodings().includes(encoding))) {
|
|
11
11
|
endResponse(new fetchAPI.Response(`Unsupported 'Content-Encoding': ${contentEncodingHeader}`, {
|
package/esm/utils.js
CHANGED
|
@@ -500,7 +500,7 @@ export function getSupportedEncodings() {
|
|
|
500
500
|
}
|
|
501
501
|
export function handleResponseDecompression(response, ResponseCtor) {
|
|
502
502
|
const contentEncodingHeader = response?.headers.get('content-encoding');
|
|
503
|
-
if (!contentEncodingHeader) {
|
|
503
|
+
if (!contentEncodingHeader || contentEncodingHeader === 'none') {
|
|
504
504
|
return response;
|
|
505
505
|
}
|
|
506
506
|
if (!response?.body) {
|