Skip to content

Commit 418c204

Browse files
Allow requests from mmif-elastic server
1 parent 54ba622 commit 418c204

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ def upload():
3535
# unavailable because no secret key was set). This was solved in the
3636
# __main__ block by setting a key.
3737
if request.method == 'POST':
38-
# check if the post request has the file part
39-
if 'file' not in request.files:
38+
# Check if request is coming from elasticsearch
39+
if 'data' in request.form:
40+
return render_mmif(request.form['data'])
41+
# Otherwise, check if the post request has the file part
42+
elif 'file' not in request.files:
4043
flash('WARNING: post request has no file part')
4144
return redirect(request.url)
4245
file = request.files['file']

0 commit comments

Comments
 (0)