fix(ff): throw friendly message on fetching redirect body (#8594)
This commit is contained in:
parent
74e6f2756a
commit
0e6620ce94
|
|
@ -418,7 +418,7 @@ export class Response extends SdkObject {
|
||||||
body(): Promise<Buffer> {
|
body(): Promise<Buffer> {
|
||||||
if (!this._contentPromise) {
|
if (!this._contentPromise) {
|
||||||
this._contentPromise = this._finishedPromise.then(async () => {
|
this._contentPromise = this._finishedPromise.then(async () => {
|
||||||
if (this._request._redirectedTo)
|
if (this._status >= 300 && this._status <= 399)
|
||||||
throw new Error('Response body is unavailable for redirect responses');
|
throw new Error('Response body is unavailable for redirect responses');
|
||||||
return this._getResponseBodyCallback();
|
return this._getResponseBodyCallback();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue