forked from orbit-oss/flask
parent
f347d3c59e
commit
c52e1b7388
3 changed files with 30 additions and 2 deletions
|
|
@ -468,7 +468,7 @@ class TestSendfile(object):
|
|||
|
||||
@pytest.mark.skipif(
|
||||
not callable(getattr(Range, 'to_content_range_header', None)),
|
||||
reason="not implement within werkzeug"
|
||||
reason="not implemented within werkzeug"
|
||||
)
|
||||
def test_send_file_range_request(self):
|
||||
app = flask.Flask(__name__)
|
||||
|
|
@ -529,6 +529,25 @@ class TestSendfile(object):
|
|||
assert rv.status_code == 200
|
||||
rv.close()
|
||||
|
||||
@pytest.mark.skipif(
|
||||
not callable(getattr(Range, 'to_content_range_header', None)),
|
||||
reason="not implemented within werkzeug"
|
||||
)
|
||||
def test_send_file_range_request_xsendfile_invalid(self):
|
||||
# https://github.com/pallets/flask/issues/2526
|
||||
app = flask.Flask(__name__)
|
||||
app.use_x_sendfile = True
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return flask.send_file('static/index.html', conditional=True)
|
||||
|
||||
c = app.test_client()
|
||||
|
||||
rv = c.get('/', headers={'Range': 'bytes=1000-'})
|
||||
assert rv.status_code == 416
|
||||
rv.close()
|
||||
|
||||
def test_attachment(self):
|
||||
app = flask.Flask(__name__)
|
||||
with app.test_request_context():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue