Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug using headers #5

Closed
Inrego opened this issue Aug 18, 2015 · 1 comment
Closed

Bug using headers #5

Inrego opened this issue Aug 18, 2015 · 1 comment
Labels

Comments

@Inrego
Copy link

Inrego commented Aug 18, 2015

Hey I found a bug when using headers.

  var url = this.target.replace("<name>", file.name);
  xhr.open(this.method, url, true);
  for (key in this.headers) {
    if (headers.hasOwnProperty(key)) {
      xhr.setRequestHeader(key, this.headers[key]);
    }
  }

Should be:

  var url = this.target.replace("<name>", file.name);
  xhr.open(this.method, url, true);
  for (key in this.headers) {
    if (this.headers.hasOwnProperty(key)) {
      xhr.setRequestHeader(key, this.headers[key]);
    }
  }

The change is this.headers in the if-statement. Without this, it'll throw an error that headers is undefined.

@winhowes
Copy link
Owner

Oh great catch! Thanks so much

@winhowes winhowes added the bug label Aug 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants