code: function () {
                  if (headerResponse !== null) {
                      return headerResponse;
                  }
                  // Read status and normalize an IE9 bug (http://bugs.jquery.com/ticket/1450).
                  var status = xhr.status === 1223 ? 204 : xhr.status;
                  var statusText = xhr.statusText || 'OK';
                  // Parse headers from XMLHttpRequest - this step is lazy.
                  var headers = new HttpHeaders(xhr.getAllResponseHeaders());
                  // Read the response URL from the XMLHttpResponse instance and fall back on the
                  // request URL.
                  var url = getResponseUrl(xhr) || req.url;
                  // Construct the HttpHeaderResponse and memoize it.
                  headerResponse = new HttpHeaderResponse({ headers: headers, status: status, statusText: statusText, url: url });
                  return headerResponse;
              }
docs: partialFromXhr extracts the HttpHeaderResponse from the current XMLHttpRequest state, and memoizes it into headerResponse.