提交 6483d338 编写于 作者: I Isaac Yang

Upgrade Flask to fix security vulnerability

Update document and javascript
上级 629a11cf
# Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from flask.ext.wtf import Form
from flask_wtf import Form
from wtforms.validators import DataRequired
from digits import utils
......
......@@ -80,7 +80,7 @@ class BaseViewsTestWithDataset(BaseViewsTest):
request_json = data.pop('json', False)
url = '/datasets/generic/create/%s' % cls.EXTENSION_ID
if request_json:
url += '.json'
url += '/json'
rv = cls.app.post(url, data=data)
......@@ -110,7 +110,7 @@ class BaseViewsTestWithDataset(BaseViewsTest):
@classmethod
def get_dataset_json(cls):
rv = cls.app.get('/datasets/%s.json' % cls.dataset_id)
rv = cls.app.get('/datasets/%s/json' % cls.dataset_id)
assert rv.status_code == 200, 'page load failed with %s' % rv.status_code
return json.loads(rv.data)
......@@ -262,7 +262,7 @@ class GenericCreationTest(BaseViewsTestWithDataset):
job1_id = self.create_dataset(**options_1)
assert self.dataset_wait_completion(job1_id) == 'Done', 'first job failed'
rv = self.app.get('/datasets/%s.json' % job1_id)
rv = self.app.get('/datasets/%s/json' % job1_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content1 = json.loads(rv.data)
......@@ -273,7 +273,7 @@ class GenericCreationTest(BaseViewsTestWithDataset):
job2_id = self.create_dataset(**options_2)
assert self.dataset_wait_completion(job2_id) == 'Done', 'second job failed'
rv = self.app.get('/datasets/%s.json' % job2_id)
rv = self.app.get('/datasets/%s/json' % job2_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content2 = json.loads(rv.data)
......@@ -296,7 +296,7 @@ class GenericCreatedTest(BaseViewsTestWithDataset):
"""
def test_index_json(self):
rv = self.app.get('/index.json')
rv = self.app.get('/index/json')
assert rv.status_code == 200, 'page load failed with %s' % rv.status_code
content = json.loads(rv.data)
found = False
......
......@@ -58,7 +58,7 @@ def new(extension_id):
)
@blueprint.route('/create/<extension_id>.json', methods=['POST'])
@blueprint.route('/create/<extension_id>/json', methods=['POST'])
@blueprint.route('/create/<extension_id>',
methods=['POST'],
strict_slashes=False)
......
......@@ -122,7 +122,7 @@ class BaseViewsTestWithImageset(BaseViewsTest):
request_json = data.pop('json', False)
url = '/datasets/images/classification'
if request_json:
url += '.json'
url += '/json'
rv = cls.app.post(url, data=data)
......@@ -181,7 +181,7 @@ class BaseViewsTestWithDataset(BaseViewsTestWithImageset):
job1_id = self.create_dataset(**options_1)
assert self.dataset_wait_completion(job1_id) == 'Done', 'first job failed'
rv = self.app.get('/datasets/%s.json' % job1_id)
rv = self.app.get('/datasets/%s/json' % job1_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content1 = json.loads(rv.data)
......@@ -192,7 +192,7 @@ class BaseViewsTestWithDataset(BaseViewsTestWithImageset):
job2_id = self.create_dataset(**options_2)
assert self.dataset_wait_completion(job2_id) == 'Done', 'second job failed'
rv = self.app.get('/datasets/%s.json' % job2_id)
rv = self.app.get('/datasets/%s/json' % job2_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content2 = json.loads(rv.data)
......@@ -457,7 +457,7 @@ class TestCreated(BaseViewsTestWithDataset, test_utils.DatasetMixin):
"""
def test_index_json(self):
rv = self.app.get('/index.json')
rv = self.app.get('/index/json')
assert rv.status_code == 200, 'page load failed with %s' % rv.status_code
content = json.loads(rv.data)
found = False
......@@ -468,7 +468,7 @@ class TestCreated(BaseViewsTestWithDataset, test_utils.DatasetMixin):
assert found, 'dataset not found in list'
def test_dataset_json(self):
rv = self.app.get('/datasets/%s.json' % self.dataset_id)
rv = self.app.get('/datasets/%s/json' % self.dataset_id)
assert rv.status_code == 200, 'page load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert content['id'] == self.dataset_id, 'expected different job_id'
......@@ -499,7 +499,7 @@ class TestCreated(BaseViewsTestWithDataset, test_utils.DatasetMixin):
assert status == 200, 'failed with %s' % status
def test_backend_selection(self):
rv = self.app.get('/datasets/%s.json' % self.dataset_id)
rv = self.app.get('/datasets/%s/json' % self.dataset_id)
content = json.loads(rv.data)
for task in content['CreateDbTasks']:
assert task['backend'] == self.BACKEND
......@@ -554,7 +554,7 @@ class TestCreatedHdf5(TestCreated, test_utils.DatasetMixin):
BACKEND = 'hdf5'
def test_compression_method(self):
rv = self.app.get('/datasets/%s.json' % self.dataset_id)
rv = self.app.get('/datasets/%s/json' % self.dataset_id)
content = json.loads(rv.data)
for task in content['CreateDbTasks']:
assert task['compression'] == self.COMPRESSION
......
......@@ -373,7 +373,7 @@ def new():
return flask.render_template('datasets/images/classification/new.html', form=form)
@blueprint.route('.json', methods=['POST'])
@blueprint.route('/json', methods=['POST'])
@blueprint.route('', methods=['POST'], strict_slashes=False)
@utils.auth.requires_login(redirect=False)
def create():
......
......@@ -96,7 +96,7 @@ class BaseViewsTestWithImageset(BaseViewsTest):
request_json = data.pop('json', False)
url = '/datasets/images/generic'
if request_json:
url += '.json'
url += '/json'
rv = cls.app.post(url, data=data)
......@@ -199,7 +199,7 @@ class TestCreation(BaseViewsTestWithImageset, test_utils.DatasetMixin):
job1_id = self.create_dataset(**options_1)
assert self.dataset_wait_completion(job1_id) == 'Done', 'first job failed'
rv = self.app.get('/datasets/%s.json' % job1_id)
rv = self.app.get('/datasets/%s/json' % job1_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content1 = json.loads(rv.data)
......@@ -210,7 +210,7 @@ class TestCreation(BaseViewsTestWithImageset, test_utils.DatasetMixin):
job2_id = self.create_dataset(**options_2)
assert self.dataset_wait_completion(job2_id) == 'Done', 'second job failed'
rv = self.app.get('/datasets/%s.json' % job2_id)
rv = self.app.get('/datasets/%s/json' % job2_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content2 = json.loads(rv.data)
......@@ -233,7 +233,7 @@ class TestCreated(BaseViewsTestWithDataset, test_utils.DatasetMixin):
"""
def test_index_json(self):
rv = self.app.get('/index.json')
rv = self.app.get('/index/json')
assert rv.status_code == 200, 'page load failed with %s' % rv.status_code
content = json.loads(rv.data)
found = False
......@@ -244,7 +244,7 @@ class TestCreated(BaseViewsTestWithDataset, test_utils.DatasetMixin):
assert found, 'dataset not found in list'
def test_dataset_json(self):
rv = self.app.get('/datasets/%s.json' % self.dataset_id)
rv = self.app.get('/datasets/%s/json' % self.dataset_id)
assert rv.status_code == 200, 'page load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert content['id'] == self.dataset_id, 'expected different job_id'
......
......@@ -28,7 +28,7 @@ def new():
return flask.render_template('datasets/images/generic/new.html', form=form)
@blueprint.route('.json', methods=['POST'])
@blueprint.route('/json', methods=['POST'])
@blueprint.route('', methods=['POST'], strict_slashes=False)
@utils.auth.requires_login(redirect=False)
def create():
......
......@@ -13,7 +13,7 @@ from digits.webapp import scheduler
blueprint = flask.Blueprint(__name__, __name__)
@blueprint.route('/<job_id>.json', methods=['GET'])
@blueprint.route('/<job_id>/json', methods=['GET'])
@blueprint.route('/<job_id>', methods=['GET'])
def show(job_id):
"""
......
......@@ -3,7 +3,7 @@ from __future__ import absolute_import
import os
from flask.ext.wtf import Form
from flask_wtf import Form
from wtforms import validators
from digits import utils
......
......@@ -3,7 +3,7 @@ from __future__ import absolute_import
import os
from flask.ext.wtf import Form
from flask_wtf import Form
from wtforms import validators
from digits import utils
......
# Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from flask.ext.wtf import Form
from flask_wtf import Form
import os
from wtforms import validators
......
......@@ -2,7 +2,7 @@
from __future__ import absolute_import
from digits.utils import subclass
from flask.ext.wtf import Form
from flask_wtf import Form
@subclass
......
# Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from flask.ext.wtf import Form
from flask_wtf import Form
from digits import utils
from digits.utils import subclass
......
# Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from flask.ext.wtf import Form
from flask_wtf import Form
from digits import utils
from digits.utils import subclass
......
......@@ -2,7 +2,7 @@
from __future__ import absolute_import
from digits.utils import subclass
from flask.ext.wtf import Form
from flask_wtf import Form
@subclass
......
......@@ -3,7 +3,7 @@
import os
import flask
from flask.ext.wtf import Form
from flask_wtf import Form
import wtforms
from wtforms import validators
......
......@@ -256,7 +256,7 @@ class BaseViewsTestWithDataset(BaseViewsTest,
request_json = data.pop('json', False)
url = '/models/images/classification'
if request_json:
url += '.json'
url += '/json'
rv = cls.app.post(url, data=data)
......@@ -361,7 +361,7 @@ class BaseTestCreation(BaseViewsTestWithDataset):
def test_snapshot_interval_2(self):
job_id = self.create_model(snapshot_interval=0.5)
assert self.model_wait_completion(job_id) == 'Done', 'create failed'
rv = self.app.get('/models/%s.json' % job_id)
rv = self.app.get('/models/%s/json' % job_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert len(content['snapshots']) > 1, 'should take >1 snapshot'
......@@ -369,7 +369,7 @@ class BaseTestCreation(BaseViewsTestWithDataset):
def test_snapshot_interval_0_5(self):
job_id = self.create_model(train_epochs=4, snapshot_interval=2)
assert self.model_wait_completion(job_id) == 'Done', 'create failed'
rv = self.app.get('/models/%s.json' % job_id)
rv = self.app.get('/models/%s/json' % job_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert len(content['snapshots']) == 2, 'should take 2 snapshots'
......@@ -455,7 +455,7 @@ class BaseTestCreation(BaseViewsTestWithDataset):
def test_retrain(self):
job1_id = self.create_model()
assert self.model_wait_completion(job1_id) == 'Done', 'first job failed'
rv = self.app.get('/models/%s.json' % job1_id)
rv = self.app.get('/models/%s/json' % job1_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert len(content['snapshots']), 'should have at least snapshot'
......@@ -473,7 +473,7 @@ class BaseTestCreation(BaseViewsTestWithDataset):
# retrain from a job which already had a pretrained model
job1_id = self.create_model()
assert self.model_wait_completion(job1_id) == 'Done', 'first job failed'
rv = self.app.get('/models/%s.json' % job1_id)
rv = self.app.get('/models/%s/json' % job1_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert len(content['snapshots']), 'should have at least snapshot'
......@@ -567,7 +567,7 @@ class UserModel(Tower):
job1_id = self.create_model(**options_1)
assert self.model_wait_completion(job1_id) == 'Done', 'first job failed'
rv = self.app.get('/models/%s.json' % job1_id)
rv = self.app.get('/models/%s/json' % job1_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content1 = json.loads(rv.data)
......@@ -578,7 +578,7 @@ class UserModel(Tower):
job2_id = self.create_model(**options_2)
assert self.model_wait_completion(job2_id) == 'Done', 'second job failed'
rv = self.app.get('/models/%s.json' % job2_id)
rv = self.app.get('/models/%s/json' % job2_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content2 = json.loads(rv.data)
......@@ -627,7 +627,7 @@ class BaseTestCreated(BaseViewsTestWithModel):
assert rv.status_code == 200, 'download "%s" failed with %s' % (url, rv.status_code)
def test_index_json(self):
rv = self.app.get('/index.json')
rv = self.app.get('/index/json')
assert rv.status_code == 200, 'page load failed with %s' % rv.status_code
content = json.loads(rv.data)
found = False
......@@ -638,7 +638,7 @@ class BaseTestCreated(BaseViewsTestWithModel):
assert found, 'model not found in list'
def test_model_json(self):
rv = self.app.get('/models/%s.json' % self.model_id)
rv = self.app.get('/models/%s/json' % self.model_id)
assert rv.status_code == 200, 'page load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert content['id'] == self.model_id, 'id %s != %s' % (content['id'], self.model_id)
......@@ -693,7 +693,7 @@ class BaseTestCreated(BaseViewsTestWithModel):
image_upload = (StringIO(infile.read()), 'image.png')
rv = self.app.post(
'/models/images/classification/classify_one.json?job_id=%s' % self.model_id,
'/models/images/classification/classify_one/json?job_id=%s' % self.model_id,
data={
'image_file': image_upload,
'show_visualizations': 'y',
......@@ -781,7 +781,7 @@ class BaseTestCreated(BaseViewsTestWithModel):
file_upload = (StringIO(textfile_images), 'images.txt')
rv = self.app.post(
'/models/images/classification/classify_many.json?job_id=%s' % self.model_id,
'/models/images/classification/classify_many/json?job_id=%s' % self.model_id,
data={'image_list': file_upload}
)
assert rv.status_code == 200, 'POST failed with %s' % rv.status_code
......@@ -881,7 +881,7 @@ class BaseTestCreated(BaseViewsTestWithModel):
raise RuntimeError('job status is %s' % status)
rv = self.app.post(
'/models/images/classification/classify_one.json?job_id=%s' % self.model_id,
'/models/images/classification/classify_one/json?job_id=%s' % self.model_id,
data={'image_file': image_upload}
)
json.loads(rv.data)
......@@ -1338,7 +1338,7 @@ class PythonLayer(caffe.Layer):
shutil.rmtree(tmpdir)
assert self.model_wait_completion(job_id) == 'Done', 'first job failed'
rv = self.app.get('/models/%s.json' % job_id)
rv = self.app.get('/models/%s/json' % job_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert len(content['snapshots']), 'should have at least snapshot'
......
......@@ -86,7 +86,7 @@ def new():
)
@blueprint.route('.json', methods=['POST'])
@blueprint.route('/json', methods=['POST'])
@blueprint.route('', methods=['POST'], strict_slashes=False)
@utils.auth.requires_login(redirect=False)
def create():
......@@ -370,7 +370,7 @@ def large_graph():
return flask.render_template('models/large_graph.html', job=job)
@blueprint.route('/classify_one.json', methods=['POST'])
@blueprint.route('/classify_one/json', methods=['POST'])
@blueprint.route('/classify_one', methods=['POST', 'GET'])
def classify_one():
"""
......@@ -462,7 +462,7 @@ def classify_one():
), status_code
@blueprint.route('/classify_many.json', methods=['POST'])
@blueprint.route('/classify_many/json', methods=['POST'])
@blueprint.route('/classify_many', methods=['POST', 'GET'])
def classify_many():
"""
......
......@@ -206,7 +206,7 @@ class BaseViewsTestWithAnyDataset(BaseViewsTest):
request_json = data.pop('json', False)
url = '/models/images/generic'
if request_json:
url += '.json'
url += '/json'
rv = cls.app.post(url, data=data)
......@@ -322,7 +322,7 @@ class BaseTestCreation(BaseViewsTestWithDataset):
def test_snapshot_interval_2(self):
job_id = self.create_model(snapshot_interval=0.5)
assert self.model_wait_completion(job_id) == 'Done', 'create failed'
rv = self.app.get('/models/%s.json' % job_id)
rv = self.app.get('/models/%s/json' % job_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert len(content['snapshots']) > 1, 'should take >1 snapshot'
......@@ -330,7 +330,7 @@ class BaseTestCreation(BaseViewsTestWithDataset):
def test_snapshot_interval_0_5(self):
job_id = self.create_model(train_epochs=4, snapshot_interval=2)
assert self.model_wait_completion(job_id) == 'Done', 'create failed'
rv = self.app.get('/models/%s.json' % job_id)
rv = self.app.get('/models/%s/json' % job_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert len(content['snapshots']) == 2, 'should take 2 snapshots'
......@@ -411,7 +411,7 @@ class BaseTestCreation(BaseViewsTestWithDataset):
def test_retrain(self):
job1_id = self.create_model()
assert self.model_wait_completion(job1_id) == 'Done', 'first job failed'
rv = self.app.get('/models/%s.json' % job1_id)
rv = self.app.get('/models/%s/json' % job1_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert len(content['snapshots']), 'should have at least snapshot'
......@@ -429,7 +429,7 @@ class BaseTestCreation(BaseViewsTestWithDataset):
# retrain from a job which already had a pretrained model
job1_id = self.create_model()
assert self.model_wait_completion(job1_id) == 'Done', 'first job failed'
rv = self.app.get('/models/%s.json' % job1_id)
rv = self.app.get('/models/%s/json' % job1_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert len(content['snapshots']), 'should have at least snapshot'
......@@ -483,7 +483,7 @@ class BaseTestCreation(BaseViewsTestWithDataset):
job1_id = self.create_model(**options_1)
assert self.model_wait_completion(job1_id) == 'Done', 'first job failed'
rv = self.app.get('/models/%s.json' % job1_id)
rv = self.app.get('/models/%s/json' % job1_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content1 = json.loads(rv.data)
......@@ -494,7 +494,7 @@ class BaseTestCreation(BaseViewsTestWithDataset):
job2_id = self.create_model(**options_2)
assert self.model_wait_completion(job2_id) == 'Done', 'second job failed'
rv = self.app.get('/models/%s.json' % job2_id)
rv = self.app.get('/models/%s/json' % job2_id)
assert rv.status_code == 200, 'json load failed with %s' % rv.status_code
content2 = json.loads(rv.data)
......@@ -544,7 +544,7 @@ class BaseTestCreatedWithAnyDataset(BaseViewsTestWithModelWithAnyDataset):
assert rv.status_code == 200, 'download "%s" failed with %s' % (url, rv.status_code)
def test_index_json(self):
rv = self.app.get('/index.json')
rv = self.app.get('/index/json')
assert rv.status_code == 200, 'page load failed with %s' % rv.status_code
content = json.loads(rv.data)
found = False
......@@ -555,7 +555,7 @@ class BaseTestCreatedWithAnyDataset(BaseViewsTestWithModelWithAnyDataset):
assert found, 'model not found in list'
def test_model_json(self):
rv = self.app.get('/models/%s.json' % self.model_id)
rv = self.app.get('/models/%s/json' % self.model_id)
assert rv.status_code == 200, 'page load failed with %s' % rv.status_code
content = json.loads(rv.data)
assert content['id'] == self.model_id, 'expected different job_id'
......@@ -599,7 +599,7 @@ class BaseTestCreatedWithAnyDataset(BaseViewsTestWithModelWithAnyDataset):
image_upload = (StringIO(infile.read()), 'image.png')
rv = self.app.post(
'/models/images/generic/infer_one.json?job_id=%s' % self.model_id,
'/models/images/generic/infer_one/json?job_id=%s' % self.model_id,
data={
'image_file': image_upload,
}
......@@ -669,7 +669,7 @@ class BaseTestCreatedWithAnyDataset(BaseViewsTestWithModelWithAnyDataset):
file_upload = (StringIO(textfile_images), 'images.txt')
rv = self.app.post(
'/models/images/generic/infer_many.json?job_id=%s' % self.model_id,
'/models/images/generic/infer_many/json?job_id=%s' % self.model_id,
data={'image_list': file_upload}
)
assert rv.status_code == 200, 'POST failed with %s' % rv.status_code
......@@ -680,7 +680,7 @@ class BaseTestCreatedWithAnyDataset(BaseViewsTestWithModelWithAnyDataset):
if self.val_db_path is None:
raise unittest.SkipTest('Class has no validation db')
rv = self.app.post(
'/models/images/generic/infer_db.json?job_id=%s' % self.model_id,
'/models/images/generic/infer_db/json?job_id=%s' % self.model_id,
data={'db_path': self.val_db_path}
)
assert rv.status_code == 200, 'POST failed with %s\n\n%s' % (rv.status_code, rv.data)
......@@ -726,7 +726,7 @@ class BaseTestCreatedWithGradientDataExtension(BaseTestCreatedWithAnyDataset,
def test_infer_extension_json(self):
rv = self.app.post(
'/models/images/generic/infer_extension.json?job_id=%s' % self.model_id,
'/models/images/generic/infer_extension/json?job_id=%s' % self.model_id,
data={
'gradient_x': 0.5,
'gradient_y': -0.5,
......@@ -824,7 +824,7 @@ class UserModel(Tower):
image_upload = (StringIO(infile.read()), 'image.png')
rv = self.app.post(
'/models/images/generic/infer_one.json?job_id=%s' % self.model_id,
'/models/images/generic/infer_one/json?job_id=%s' % self.model_id,
data={'image_file': image_upload}
)
assert rv.status_code == 200, 'POST failed with %s' % rv.status_code
......@@ -861,7 +861,7 @@ class UserModel(Tower):
image_upload = (s, 'image.png')
# post request
rv = self.app.post(
'/models/images/generic/infer_one.json?job_id=%s' % self.model_id,
'/models/images/generic/infer_one/json?job_id=%s' % self.model_id,
data={'image_file': image_upload, 'dont_resize': 'y'}
)
assert rv.status_code == 200, 'POST failed with %s' % rv.status_code
......@@ -1218,7 +1218,7 @@ end
image_upload = (StringIO(infile.read()), 'image.png')
rv = self.app.post(
'/models/images/generic/infer_one.json?job_id=%s' % self.model_id,
'/models/images/generic/infer_one/json?job_id=%s' % self.model_id,
data={
'image_file': image_upload,
}
......
......@@ -55,9 +55,9 @@ def new(extension_id=None):
)
@blueprint.route('<extension_id>.json', methods=['POST'])
@blueprint.route('<extension_id>/json', methods=['POST'])
@blueprint.route('<extension_id>', methods=['POST'], strict_slashes=False)
@blueprint.route('.json', methods=['POST'])
@blueprint.route('/json', methods=['POST'])
@blueprint.route('', methods=['POST'], strict_slashes=False)
@utils.auth.requires_login(redirect=False)
def create(extension_id=None):
......@@ -331,7 +331,7 @@ def large_graph():
return flask.render_template('models/large_graph.html', job=job)
@blueprint.route('/infer_one.json', methods=['POST'])
@blueprint.route('/infer_one/json', methods=['POST'])
@blueprint.route('/infer_one', methods=['POST', 'GET'])
def infer_one():
"""
......@@ -426,7 +426,7 @@ def infer_one():
), status_code
@blueprint.route('/infer_extension.json', methods=['POST'])
@blueprint.route('/infer_extension/json', methods=['POST'])
@blueprint.route('/infer_extension', methods=['POST', 'GET'])
def infer_extension():
"""
......@@ -522,7 +522,7 @@ def infer_extension():
), status_code
@blueprint.route('/infer_db.json', methods=['POST'])
@blueprint.route('/infer_db/json', methods=['POST'])
@blueprint.route('/infer_db', methods=['POST', 'GET'])
def infer_db():
"""
......@@ -608,7 +608,7 @@ def infer_db():
), status_code
@blueprint.route('/infer_many.json', methods=['POST'])
@blueprint.route('/infer_many/json', methods=['POST'])
@blueprint.route('/infer_many', methods=['POST', 'GET'])
def infer_many():
"""
......
......@@ -24,7 +24,7 @@ from digits.webapp import scheduler
blueprint = flask.Blueprint(__name__, __name__)
@blueprint.route('/<job_id>.json', methods=['GET'])
@blueprint.route('/<job_id>/json', methods=['GET'