diff options
| author | jfriedli | 2019-08-12 07:28:08 -0700 |
|---|---|---|
| committer | jvoisin | 2019-08-12 07:28:08 -0700 |
| commit | 08ce6aed7662ecf5586d6782ef6449c2ec564ed9 (patch) | |
| tree | ffbe36b7531ecb809fd38937013c005d37fb83ef | |
| parent | 28253053ffbde483a591a88a18ee21c649a0ba2d (diff) | |
adding mime type to api response
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | main.py | 1 | ||||
| -rw-r--r-- | test/test_api.py | 1 |
3 files changed, 3 insertions, 0 deletions
| @@ -102,6 +102,7 @@ The `file` parameter is the base64 encoded file which will be cleaned. | |||
| 102 | ```json | 102 | ```json |
| 103 | { | 103 | { |
| 104 | "output_filename": "fancy.cleaned.jpg", | 104 | "output_filename": "fancy.cleaned.jpg", |
| 105 | "mime": "image/jpg", | ||
| 105 | "key": "81a541f9ebc0233d419d25ed39908b16f82be26a783f32d56c381559e84e6161", | 106 | "key": "81a541f9ebc0233d419d25ed39908b16f82be26a783f32d56c381559e84e6161", |
| 106 | "meta": { | 107 | "meta": { |
| 107 | "BitDepth": 8, | 108 | "BitDepth": 8, |
| @@ -147,6 +147,7 @@ def create_app(test_config=None): | |||
| 147 | key, meta_after, output_filename = cleanup(parser, filepath) | 147 | key, meta_after, output_filename = cleanup(parser, filepath) |
| 148 | return { | 148 | return { |
| 149 | 'output_filename': output_filename, | 149 | 'output_filename': output_filename, |
| 150 | 'mime': mime, | ||
| 150 | 'key': key, | 151 | 'key': key, |
| 151 | 'meta': meta, | 152 | 'meta': meta, |
| 152 | 'meta_after': meta_after, | 153 | 'meta_after': meta_after, |
diff --git a/test/test_api.py b/test/test_api.py index d913cc4..de33355 100644 --- a/test/test_api.py +++ b/test/test_api.py | |||
| @@ -37,6 +37,7 @@ class Mat2APITestCase(unittest.TestCase): | |||
| 37 | data = json.loads(request.data.decode('utf-8')) | 37 | data = json.loads(request.data.decode('utf-8')) |
| 38 | expected = { | 38 | expected = { |
| 39 | 'output_filename': 'test_name.cleaned.jpg', | 39 | 'output_filename': 'test_name.cleaned.jpg', |
| 40 | 'mime': 'image/jpeg', | ||
| 40 | 'key': '81a541f9ebc0233d419d25ed39908b16f82be26a783f32d56c381559e84e6161', | 41 | 'key': '81a541f9ebc0233d419d25ed39908b16f82be26a783f32d56c381559e84e6161', |
| 41 | 'meta': { | 42 | 'meta': { |
| 42 | 'BitDepth': 8, | 43 | 'BitDepth': 8, |
