directory middleware accept text/json not responding with json #829

Closed
ghost opened this Issue Jun 25, 2013 · 6 comments

Projects

None yet

3 participants

@ghost
ghost commented Jun 25, 2013

https://github.com/senchalabs/connect/blob/master/lib/middleware/directory.js#L92

this patches the problems for my needs
95 if (accept.indexOf(key)>-1 ) {

@tj
Member
tj commented Jun 26, 2013

that's what ~accept.indexOf() means as well

@tj tj closed this Jun 26, 2013
@ghost
ghost commented Jun 27, 2013

http://stackoverflow.com/questions/5331452/http-accept-header-meaning
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

this is the header i am requesting with
screen shot 2013-06-27 at 12 08 36 pm

sorry for such a poor initial bug report

@tj
Member
tj commented Jun 27, 2013

ah ok I see, yeah since it has */* in there it's assumed the first one is fine. We just need to properly parse quality

@tj tj reopened this Jun 27, 2013
@dougwilson
Contributor

The code necessary for true content negotiation is part of express and not connect, so it may not be very feasible to add this to the connect middleware.

@dougwilson
Contributor

But we can at least make it simply consider */* last instead of first like it does now.

@dougwilson
Contributor

#923 was merged, which fixed this issue.

@jonathanong
Contributor

oh yeah!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment