Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(ff): throw friendly message on fetching redirect body (#8594)

Pavel Feldman0e6620ce94f1
diff --git a/src/server/network.ts b/src/server/network.ts
index dd942146be..dbfed29520 100644
--- a/src/server/network.ts
+++ b/src/server/network.ts
@@ -418,7 +418,7 @@ export class Response extends SdkObject {
body(): Promise<Buffer> {
if (!this._contentPromise) {
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');
return this._getResponseBodyCallback();
});