function copyStatusAndHeaders(xhr, conn) {
  conn.response.headers = xhr.getAllResponseHeaders();
  conn.status = xhr.status;
  return conn.status;
}