-
Notifications
You must be signed in to change notification settings - Fork 421
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
Kinto creates blank record on Content-Type:text/plain #461
Kinto creates blank record on Content-Type:text/plain #461
Conversation
You are right we should return a |
Surprisingly, there are tests about that in cornice: https://github.com/mozilla-services/cornice/blob/master/cornice/tests/test_validation.py#L192-L228 |
I have added failing tests so that we can investigate why cornice doesn't catch the matter. |
Tests are passing with this branch: https://github.com/mozilla-services/cliquet/pull/667/files |
headers=headers, | ||
status=415) | ||
|
||
def test_records_should_reject_unaccepted_client_accept(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can also duplicate this code in groups/buckets and collection if you think it is a good idea to do it.
Since the code is in Cliquet it is unlikely that they will fail if the other one passes.
It is just some functional tests to make sure that what we want for Kinto is working regardless of cornice or cliquet changes.
I got it working. If we define the content_type while registering a service in cornice, the corince would take it as a default validator. link : http://cornice.readthedocs.org/en/latest/validation.html#content-type-validation so I have changed code in https://github.com/mozilla-services/cliquet/blob/master/cliquet/resource/__init__.py#L70-L79
and it gives the response on content-type: text/plain as :
I came across this conversation Cornices/cornice#192 |
Waiting on mozilla-services/cliquet#667 to get merged |
283cfc7
to
d9ab9db
Compare
mozilla-services/cliquet#667 has been merged. |
Test are passing on cliquet master: https://travis-ci.org/Kinto/kinto/jobs/112033653 We need a release before merging this. |
…default Do not instantiate backends if not configured (fixes Kinto#386)
As Kinto is JSON Datastore and whenever we POST text/plain instead of JSON it creates a blank record in DB instead of rejecting text/plain requests.
Request:
Response :