Som-Energia / intercoop

Communication libraries for social economy entities to cross services for their members.
GNU Affero General Public License v3.0
2 stars 2 forks source link

Proper content type header in example #2

Closed ghost closed 6 years ago

vokimon commented 6 years ago

@bernatixer could you elaborate why this fix is needed?

bernatixer commented 6 years ago

While trying to test intercoop, we faced a "Wrong mime type received" error. We found that the correct way to find the mime type was using 'content-type', so it was just changing the '_' for the '-', probably a typo.

vokimon commented 6 years ago

@bernatixer I should have passed the tests before merging. They are failing. Travis has some problems on service based tests but locally i was passing them correctly before the merge. Have you passed them? Which Flask version are you using?

bernatixer commented 6 years ago

@vokimon I'm currently using Flask 1.0.2 along with Python 2.7.12

vokimon commented 6 years ago

@bernatixer Tests are fixed as well, now.

My mistake was using content_type key, like Flask does when using requests (and request_mock for tests) that use the actual http header Content-Type as key. By correcting both the test and the implementation, now the tests pass.