Skip to content

Commit 36b7aec

Browse files
bsmthhamishwillee
andauthored
fix(http): Accept-Encoding can appear in both requests and responses (#36657)
* fix(http): Accept-Encoding can appear in both requests and responses * Update files/en-us/web/http/headers/accept-encoding/index.md Co-authored-by: Hamish Willee <[email protected]> --------- Co-authored-by: Hamish Willee <[email protected]>
1 parent 6bb832e commit 36b7aec

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.vscode/dictionaries/terms-abbreviations.txt

+2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ BMFF
8383
bootup
8484
botmaster
8585
BPTC
86+
Brotli
8687
browserless
8788
BSAC
8889
bytestream
@@ -880,5 +881,6 @@ yearless
880881
Zalgo
881882
zoomable
882883
ZQSD
884+
Zstandard
883885
ZWNBSP
884886
ZWSP

files/en-us/web/http/headers/accept-encoding/index.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ browser-compat: http.headers.Accept-Encoding
77

88
{{HTTPSidebar}}
99

10-
The HTTP **`Accept-Encoding`** {{Glossary("request header")}} indicates the content encoding (usually a compression algorithm) that the client can understand. The server uses [content negotiation](/en-US/docs/Web/HTTP/Content_negotiation) to select one of the proposals and informs the client of that choice with the {{HTTPHeader("Content-Encoding")}} response header.
10+
The HTTP **`Accept-Encoding`** {{glossary("request header", "request")}} and {{glossary("response header")}} indicates the content encoding (usually a compression algorithm) that the recipient can understand.
11+
In requests, the server uses [content negotiation](/en-US/docs/Web/HTTP/Content_negotiation) to select one of the encoding proposals from the client and informs the client of that choice with the {{HTTPHeader("Content-Encoding")}} response header.
12+
In responses, it provides information about which content encodings the server can understand in messages to the requested resource, so that the encoding can be used in subsequent requests to the resource. For example, this might be sent in the response to a `PUT` request to a resource that used an unsupported encoding.
1113

1214
Even if both the client and the server support the same compression algorithms, the server may choose not to compress the body of a response if the `identity` value is also acceptable.
1315
This happens in two common cases:
@@ -26,7 +28,7 @@ As long as the `identity;q=0` or `*;q=0` directives do not explicitly forbid the
2628
<tbody>
2729
<tr>
2830
<th scope="row">Header type</th>
29-
<td>{{Glossary("Request header")}}</td>
31+
<td>{{Glossary("Request header")}}, {{Glossary("Response header")}}</td>
3032
</tr>
3133
<tr>
3234
<th scope="row">{{Glossary("Forbidden header name")}}</th>
@@ -64,7 +66,7 @@ Accept-Encoding: deflate, gzip;q=1.0, *;q=0.5
6466
- : A compression format that uses the [Zstandard](https://en.wikipedia.org/wiki/Zstd) algorithm.
6567
- `identity`
6668
- : Indicates the identity function (that is, without modification or compression). This value is always considered as acceptable, even if omitted.
67-
- `*`
69+
- `*` (wildcard)
6870
- : Matches any content encoding not already listed in the header. This is the default value if the header is not present. This directive does not suggest that any algorithm is supported but indicates that no preference is expressed.
6971
- `;q=` (qvalues weighting)
7072
- : Any value is placed in an order of preference expressed using a relative [quality value](/en-US/docs/Glossary/Quality_values) called _weight_.
@@ -83,7 +85,7 @@ Accept-Encoding: gzip, deflate, br, zstd
8385

8486
### Weighted Accept-Encoding values
8587

86-
The following request header shows `Accept-Encoding` preferences using a quality value between `0` (lowest priority) and `1` (highest-priority).
88+
The following header shows `Accept-Encoding` preferences using a quality value between `0` (lowest priority) and `1` (highest-priority).
8789
Brotli compression is weighted at `1.0`, making `br` the client's first choice, followed by `gzip` at `0.8` priority, and then any other content encoding at `0.1`:
8890

8991
```http

0 commit comments

Comments
 (0)