@api-client/core 0.8.10 → 0.8.12

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.
@@ -128,6 +128,7 @@ export abstract class HttpEngine extends EventEmitter {
128
128
  * The current sent request
129
129
  */
130
130
  sentRequest: SentRequest;
131
+
131
132
  redirects: ResponseRedirect[] = [];
132
133
  /**
133
134
  * When true the request has been aborted.
@@ -589,7 +590,7 @@ Check your request parameters.`);
589
590
  }
590
591
  message = message || 'Unknown error occurred';
591
592
  const error = new SerializableError(message, opts.code);
592
- const log = RequestLog.fromRequest(this.sentRequest);
593
+ const log = RequestLog.fromRequest(this.sentRequest.toJSON());
593
594
  const response = ErrorResponse.fromError(error);
594
595
  log.response = response;
595
596
  if (currentResponse && currentResponse.status) {
@@ -633,7 +634,7 @@ Check your request parameters.`);
633
634
  if (!response) {
634
635
  return;
635
636
  }
636
- const result = RequestLog.fromRequestResponse(this.sentRequest, response.toJSON());
637
+ const result = RequestLog.fromRequestResponse(this.sentRequest.toJSON(), response.toJSON());
637
638
  if (this.redirects.length) {
638
639
  result.redirects = this.redirects;
639
640
  }
@@ -720,7 +721,7 @@ Check your request parameters.`);
720
721
  _processRedirectCookies(responseCookies: string, location: string): void {
721
722
  const received = CookieParser.parse(this.request.url, responseCookies);
722
723
  const forwardCookies = CookieParser.filterCookies(received, location);
723
- const headers = new Headers(this.request.headers);
724
+ const headers = new Headers(this.request.toHeadersString());
724
725
  headers.delete('cookie');
725
726
  if (forwardCookies.length) {
726
727
  const parts: string[] = [];