I'm playing around with the SproutCore app Tasks:
http://github.com/suvajitgupta/Tasks
and it is sending the following request to Perservere:
GET
http://localhost:4400/tasks-server/user?loginName=%27SA%27&password=%27%27
with the following in the Accept header:
application/json, text/javascript, application/xml, text/xml, text/html, */*
Perservere however returns an 'application/javascript' Content-Type:
application/javascript; charset=UTF-8;schema=Class/user
With a body that looks like this:
{}&&[
{"id":"user/1",
"name":"System Admin",
"loginName":"SA",
"role":"_Manager",
"password":""
}
]
This is not valid json and 'application/javascript' is not listed an an accepted Content-Type in the request. In this case the
result is an application error.
The request in the Accept header also claims it accepts these types:
text/javascript, application/xml, text/xml, text/html, */*
I'd call that an error in the app itself because those content types will cause an error unless the response is json
masquerading as one of these types -- which certainly wouldn't be the case for a response from Perservere.
I think the app should be refactored to more accurately describe in it's requests to Perservere what Content-Type it is
expecting.
I also think Perservere needs to be fixed to not return Content-Types that aren't listed in the request Accept header.
What do people here think about this behavior from Perservere?