docs: add restricted header info to ClientRequest docs (#25075)

* docs: add restricted header info to docs

* docs: clarify header language

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
This commit is contained in:
Keeley Hammond 2020-08-25 04:29:58 -07:00 committed by GitHub
parent 35237d3c30
commit 7704954505
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,6 +171,20 @@ lowercasing. It can be called only before first write. Calling this method after
the first write will throw an error. If the passed value is not a `String`, its
`toString()` method will be called to obtain the final value.
Certain headers are restricted from being set by apps. These headers are
listed below. More information on restricted headers can be found in
[Chromium's header utils](https://source.chromium.org/chromium/chromium/src/+/master:services/network/public/cpp/header_util.cc;drc=1562cab3f1eda927938f8f4a5a91991fefde66d3;bpv=1;bpt=1;l=22).
* `Content-Length`
* `Host`
* `Trailer` or `Te`
* `Upgrade`
* `Cookie2`
* `Keep-Alive`
* `Transfer-Encoding`
Additionally, setting the `Connection` header to the value `upgrade` is also disallowed.
#### `request.getHeader(name)`
* `name` String - Specify an extra header name.