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

Parameter names should be case insensitive #37

Closed
ethanresnick opened this issue May 11, 2015 · 4 comments
Closed

Parameter names should be case insensitive #37

ethanresnick opened this issue May 11, 2015 · 4 comments
Assignees
Labels

Comments

@ethanresnick
Copy link
Contributor

This comes from RFC 7231, which says: "The type, subtype, and parameter name tokens are case-insensitive."

Code to reproduce the issue:

var request = {
  headers: {
    accept: 'text/html;Charset="utf-8'
  }
};

var Negotiator = require('negotiator');
var negotiator = Negotiator(request);
var availableMediaTypes = ['text/html;charset=utf-8'];

// Expected result below: 'text/html;charset=utf-8'
// Actual result: undefined
console.log(negotiator.mediaType(availableMediaTypes))
@dougwilson dougwilson added the bug label May 11, 2015
@dougwilson dougwilson self-assigned this May 11, 2015
@dougwilson
Copy link
Contributor

lol. Gosh darn it :) Eventually when the media part uses content-type module in the next major these issues won't happen any longer :D I appreciate the report immensely!

@ethanresnick
Copy link
Contributor Author

Absolutely! I found this as I was digging through the RFCs to investigate #35. I'll leave a comment there soon with my findings, and open up other issues as they arise.

@dougwilson
Copy link
Contributor

Alright, should be fixed now :)

@dougwilson
Copy link
Contributor

Published to npm as 0.5.3

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