diff --git a/goldens/public-api/common/http/index.api.md b/goldens/public-api/common/http/index.api.md index 51b5ea158aa..5349756c46b 100644 --- a/goldens/public-api/common/http/index.api.md +++ b/goldens/public-api/common/http/index.api.md @@ -2987,6 +2987,7 @@ export abstract class HttpResponseBase { readonly redirected?: boolean; readonly responseType?: ResponseType; readonly status: number; + // @deprecated readonly statusText: string; readonly type: HttpEventType.Response | HttpEventType.ResponseHeader; readonly url: string | null; diff --git a/packages/common/http/src/response.ts b/packages/common/http/src/response.ts index eec106397c0..d3b8056357a 100644 --- a/packages/common/http/src/response.ts +++ b/packages/common/http/src/response.ts @@ -168,6 +168,8 @@ export abstract class HttpResponseBase { * Textual description of response status code, defaults to OK. * * Do not depend on this. + * + * @deprecated With HTTP/2 and later versions, this will incorrectly remain set to 'OK' even when the status code of a response is not 200. */ readonly statusText: string; @@ -405,6 +407,7 @@ export class HttpErrorResponse extends HttpResponseBase implements Error { if (this.status >= 200 && this.status < 300) { this.message = `Http failure during parsing for ${init.url || '(unknown url)'}`; } else { + // TODO: Cleanup G3 to update the tests that rely on having the status text in the Error message. this.message = `Http failure response for ${init.url || '(unknown url)'}: ${init.status} ${ init.statusText }`;