-
Notifications
You must be signed in to change notification settings - Fork 0
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
Accept: image/* returns 406 #18
Comments
That seems weird? Accept and content-type must be wired up wrong. |
This appears to be a "feature" of Restify. It doesn't have a plugin to handle responding to image MIME types, so it chucks an error back. You can provide a static list of types you accept and respond to, but it applies blindly across all endpoints. In order to get the behaviour we want in Restify we would have to either delegate control over accept headers to the individual endpoints, or write a Restify plugin that knows how to match every endpoint URL and adapts what it accepts accordingly. Neither of those are appealing options in my book. ''Edit: See following for more detail:'' Accept plugin: Passing a list of acceptable types to the createServer function: |
FYI i am dropping restify in the next ver of darkroom and going back to express / connect. Not sure on the solution to this, one could add a middleware to each required route. |
@tomgco: I think middleware would be a reasonable solution, since you could return a function from the middleware that accepts specific types and have a few of those for each type of endpoint. |
I've run the curl command and it is returning the image correctly for me.
|
I have tried passing a query string just now in the URL originally reported and see the 406 message.
|
I can confirm this happens. |
I will confirm and close if I have fixed. |
Twitterbot is using Accept: image/* when it requests images from Darkroom, which is responding with a 406 error.
Example curl:
curl -H"Accept: image/*" http://www.mytimesplus.co.uk/darkroom/1280/0/02cb1a3e56afae44ffc826329715daba:333948db2201b549b9a2d968fa58d165/gravity.jpg
Observed response:
{"code":"NotAcceptableError","message":"Server accepts: application/json,text/plain,application/octet-stream,application/javascript"}
Expected behaviour: Darkroom returns 200 with the image.
The text was updated successfully, but these errors were encountered: