Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

headers set but not sent #92

@revgum

Description

@revgum

Headers passed into the core-ajax element are being set as the prototype properties with Object.create(...).

get requestHeaders() {
  var headers = Object.create(this.headers || {});

  if (!('content-type' in headers)) {
    headers['content-type'] = this.contentType;
  }

  return headers;
},

Then in core-request, those headers aren't surfacing as part of the xhr.setRequestHeader...

It seems like a good fix would be getPrototypeOf before inspecting and setting the content-type key. I've tested this and the result is a fully populated headers object that core-request handles properly.

get requestHeaders() {
  var headers = Object.create(this.headers || {});
  headers = Object.getPrototypeOf(headers);

  if (!('content-type' in headers)) {
    headers['content-type'] = this.contentType;
  }

  return headers;
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions