got 14.4.3 → 14.4.4

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.
@@ -132,7 +132,13 @@ export default class Request extends Duplex {
132
132
  }
133
133
  if (this.options.signal) {
134
134
  const abort = () => {
135
- this.destroy(new AbortError(this));
135
+ // See https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static#return_value
136
+ if (this.options.signal?.reason?.name === 'TimeoutError') {
137
+ this.destroy(new TimeoutError(this.options.signal.reason, this.timings, this));
138
+ }
139
+ else {
140
+ this.destroy(new AbortError(this));
141
+ }
136
142
  };
137
143
  if (this.options.signal.aborted) {
138
144
  abort();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "got",
3
- "version": "14.4.3",
3
+ "version": "14.4.4",
4
4
  "description": "Human-friendly and powerful HTTP request library for Node.js",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/got",