Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
thms-rmb committed Aug 3, 2022
1 parent ad13c83 commit 5893d85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions flask_iiif/restful.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import datetime
from email.utils import parsedate
from io import BytesIO
import inspect

import funcsigs
from flask import Response, current_app, jsonify, redirect, request, send_file, url_for
from flask_restful import Resource
from flask_restful.utils import cors
Expand Down Expand Up @@ -211,7 +211,8 @@ def get(self, version, uuid, region, size, rotation, quality, image_format):
filename = u"{0}-{1}-{2}-{3}-{4}.{5}".format(
uuid, region, size, quality, rotation, image_format
)
for arg in inspect.getargspec(send_file).args:
# Necessary to support both flask 1.0 and 2.0
for arg in funcsigs.signature(send_file).parameters:
if arg in {"attachment_filename", "download_name"}:
send_file_kwargs.update({
"as_attachment": True,
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
'blinker',
'six',
'pillow',
'cachelib'
'cachelib',
'funcsigs'
]

extra_require = {
Expand Down

0 comments on commit 5893d85

Please sign in to comment.