Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Method with provides condition does not match request without Accept header #684
According to the standard:
Looks like the problem is in base.rb:
Maybe something like this, with the assumption that the provides condition lists types in order of decreasing preference:
@JonRowe As the HTTP standard is used by literally billions of devices world wide it might be best if sinatra were to conform rather than making the billions of devices use a workaround :-)
@rich Adding the header does the job but would be better to just fix the code and not make it look like the client sent the header.
I'll fork and submit a PR.
@JonRowe Not sure you're understanding the HTTP standard, the absence of an Accept header means that the client will accept any mime type. A request without an Accept header is correct. If sinatra is to conform to the HTTP standard then it must interpret the absence of an Accept header as the client will accept any mime type.