You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/2-options.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -500,51 +500,51 @@ Therefore this option has no effect when using HTTP/2.
500
500
### `copyPipedHeaders`
501
501
502
502
**Type: `boolean`**\
503
-
**Default: `true`**
503
+
**Default: `false`**
504
504
505
505
Automatically copy headers from piped streams.
506
506
507
507
When piping a request into a Got stream (e.g., `request.pipe(got.stream(url))`), this controls whether headers from the source stream are automatically merged into the Got request headers.
508
508
509
-
**Note:**Piped headers overwrite any explicitly set headers with the same name. To override this, either set `copyPipedHeaders` to `false` and manually copy safe headers, or use a `beforeRequest` hook to force specific header values after piping.
509
+
**Note:**Explicitly set headers take precedence over piped headers. Piped headers are only copied when a header is not already explicitly set.
510
510
511
-
Useful for proxy scenarios, but you may want to disable this to filter out headers like `Host`, `Connection`, `Authorization`, etc.
511
+
Useful for proxy scenarios when explicitly enabled, but you may still want to filter out headers like `Host`, `Connection`, `Authorization`, etc.
512
512
513
-
**Example: Disable automatic header copying and manually copy only safe headers**
513
+
**Example: Opt in to automatic header copying for proxy scenarios**
super(`Request failed with status code ${response.statusCode} (${response.statusMessage!}): ${response.request.options.method}${response.request.options.url!.toString()}`,{},response.request);
103
+
super(`Request failed with status code ${response.statusCode} (${response.statusMessage!}): ${response.request.options.method}${stripUrlAuth(response.request.options.url!)}`,{},response.request);
typedResponse.statusMessage||=http.STATUS_CODES[statusCode];// eslint-disable-line @typescript-eslint/prefer-nullish-coalescing -- The status message can be empty.
0 commit comments