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

iron-ajax send the "content-type" header instead of "Content-Type" #282

Open
8 tasks
albuquerq opened this issue Jul 10, 2017 · 3 comments
Open
8 tasks

Comments

@albuquerq
Copy link

albuquerq commented Jul 10, 2017

Description

iron-ajax send the "content-type" header instead of "Content-Type"

Expected outcome

Send "Content-Type"

Actual outcome

Live Demo

In file "iron-ajax.html", line 410:

get requestHeaders() {
var headers = {};
var contentType = this.contentType;
if (contentType == null && (typeof this.body === 'string')) {
contentType = 'application/x-www-form-urlencoded';
}
if (contentType) {
headers['content-type'] = contentType; // Change to 'Content-Type'
}
var header;
if (typeof this.headers === 'object') {
for (header in this.headers) {
headers[header] = this.headers[header].toString();
}
}
return headers;
}

Steps to reproduce

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10
@drix
Copy link

drix commented Jul 21, 2017

It is a valid point, need to know the implication of the current projects using it, if it would break them.

@arthurevans
Copy link
Contributor

Why would this matter? HTTP header names are supposed to be case-insensitive. https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

@drix
Copy link

drix commented Aug 2, 2017

Arthurevans, HTTP header names are indeed case insensitive, although the use of camel case make the framework looks more mature and give more confidence to users. I know is just glitter, and again doesn't hurt to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants