mirror of
https://0xacab.org/jvoisin/mat2-web.git
synced 2025-05-11 02:35:18 -04:00
adding mime type to api response
This commit is contained in:
parent
28253053ff
commit
08ce6aed76
3 changed files with 3 additions and 0 deletions
|
@ -102,6 +102,7 @@ The `file` parameter is the base64 encoded file which will be cleaned.
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"output_filename": "fancy.cleaned.jpg",
|
"output_filename": "fancy.cleaned.jpg",
|
||||||
|
"mime": "image/jpg",
|
||||||
"key": "81a541f9ebc0233d419d25ed39908b16f82be26a783f32d56c381559e84e6161",
|
"key": "81a541f9ebc0233d419d25ed39908b16f82be26a783f32d56c381559e84e6161",
|
||||||
"meta": {
|
"meta": {
|
||||||
"BitDepth": 8,
|
"BitDepth": 8,
|
||||||
|
|
1
main.py
1
main.py
|
@ -147,6 +147,7 @@ def create_app(test_config=None):
|
||||||
key, meta_after, output_filename = cleanup(parser, filepath)
|
key, meta_after, output_filename = cleanup(parser, filepath)
|
||||||
return {
|
return {
|
||||||
'output_filename': output_filename,
|
'output_filename': output_filename,
|
||||||
|
'mime': mime,
|
||||||
'key': key,
|
'key': key,
|
||||||
'meta': meta,
|
'meta': meta,
|
||||||
'meta_after': meta_after,
|
'meta_after': meta_after,
|
||||||
|
|
|
@ -37,6 +37,7 @@ class Mat2APITestCase(unittest.TestCase):
|
||||||
data = json.loads(request.data.decode('utf-8'))
|
data = json.loads(request.data.decode('utf-8'))
|
||||||
expected = {
|
expected = {
|
||||||
'output_filename': 'test_name.cleaned.jpg',
|
'output_filename': 'test_name.cleaned.jpg',
|
||||||
|
'mime': 'image/jpeg',
|
||||||
'key': '81a541f9ebc0233d419d25ed39908b16f82be26a783f32d56c381559e84e6161',
|
'key': '81a541f9ebc0233d419d25ed39908b16f82be26a783f32d56c381559e84e6161',
|
||||||
'meta': {
|
'meta': {
|
||||||
'BitDepth': 8,
|
'BitDepth': 8,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue