Commit graph

32 commits

Author SHA1 Message Date
pre-commit-ci[bot]
73f9c013cd [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-10-20 19:50:02 +00:00
Rémy HUBSCHER
711b2e50b5
Run pre-commit on all files 2024-08-05 10:53:19 +02:00
Peter Marheine
e7e25e68dd Add missing import in packaging test
This test was broken when changed to begin using importlib,
but that wasn't evident because the tests directory
wasn't being automatically tested.
2024-08-01 06:28:06 +00:00
Peter Marheine
0568c3c559 Prevent reflected file downloads on specially-named files
This fixes #196, where it was observed that django_downloadview
was vulnerable to reflected file download attacks with
specially-named files, similar to CVE-2022-36359 in Django.
This change adopts the same replacement rules as used in Django's fix
in commit b3e4494d759202a3b6bf247fd34455bf13be5b80.
2024-08-01 06:24:00 +00:00
Peter Marheine
60c1839bf5 Replace use of pkg_resources (setuptools)
Since Python 3.12, setuptools isn't included with Python
and importlib is the recommended replacement, available
since Python 3.8.
2024-07-31 11:41:25 +00:00
Davide
c51720296a
Update references to middleware settings 2024-07-30 13:01:56 +02:00
Mariusz Felisiak
293403b807 Removed passing unused size parameter to was_modified_since().
The size parameter is unused because we pass timestamp and not the
If-Modified-Since HTML header.
2022-03-14 20:38:28 +01:00
Jannis Leidel
9f42e65986
Migrate to GitHub Actions. (#165)
* Add GitHub Actions test workflow.

* Add django version env var handling to tox config.

* Update badges.

* Add release workflow.

* Remove Travis.

* Fix typo.

* Fix more typos.

* Write coverage.xml.

* Remove the need for the VERSION file.

* Simplify demo setup.py.

* Remove VERSION file.

* Update demo/setup.py

* Update setup.py
2020-12-23 11:12:35 +01:00
Rémy HUBSCHER
6cd9ec3dd0
Fix test. 2020-09-18 10:50:26 +02:00
Rémy HUBSCHER
bfb9c3cedb
Fix flake8 errors. 2020-01-13 10:46:14 +01:00
Aleksi Häkli
839b7bda38
Add signed file system storage
Fixes #138
2020-01-13 11:25:40 +02:00
Rémy HUBSCHER
56e419bfc7
Add isort config. 2020-01-07 15:51:55 +01:00
Rémy HUBSCHER
af30524bd2
Remove u'' in front of strings. 2020-01-07 15:21:34 +01:00
Rémy HUBSCHER
6c7c8d9a60
Add isort support. 2020-01-07 15:19:22 +01:00
Rémy HUBSCHER
b094ed6cec
Add black support. 2020-01-07 15:12:51 +01:00
Rémy HUBSCHER
b893e52eba
Remove support for Python 2.7 2020-01-07 15:01:26 +01:00
Fabre Florian
0ad5e1238a Fix middleware compatibility issues 2020-01-07 11:09:25 +01:00
Benoît Bryon
ec969efa7e Improved support of Python-3.5 and Django-1.9. Refs #112, refs #113. 2016-03-14 15:54:56 +01:00
Benoît Bryon
3a3d3ebb9f Refs #104 - Assert timestamp is passed to was_modified_since(). 2015-07-20 18:28:28 +02:00
Benoît Bryon
bdf8e6e368 Psycho-rebased work of @benesch and @zerc on top of master. 2015-07-20 18:14:08 +02:00
zero13cool
bf7b0f23fd Refs #104 - Convert datetime to unix timestamp 2015-07-16 22:00:27 +03:00
René Leonhardt
5e4ae2fdc9 Changed assertCalledOnceWith() to assert_called_once_with()
When I change assertCalledOnceWith() to assert_called_once_with(), make test succeeds but shows another failure:
```
AssertionError: Expected call: mock(sentinel.size, sentinel.modified_time)
Actual call: mock(sentinel.since, sentinel.modified_time, sentinel.size)
```
After changing the call accordingly, all 59 tests succeed.
2015-07-14 14:53:14 +02:00
Benoît Bryon
5fa0a6caea Psycho-rebased branch 87-double-quoted-filename on top of master 2015-06-13 00:57:44 +02:00
Benoît Bryon
ec96afda11 Refs #98 - Added __init__ script in tests/ folder. 2015-06-12 16:52:33 +02:00
Benoît Bryon
d122c68455 Refs #97 - Splitted StringIteratorIO into TextIteratorIO and BytesIteratorIO. StringIteratorIO remains for backward compatibility. 2015-06-12 16:47:46 +02:00
Benoît Bryon
c54131db6e Refs #98 - Moved tests outside django-downloadview package, i.e. in tests/ folder at project root. 2015-06-12 15:42:50 +02:00
Benoît Bryon
546bdc2461 Test of README build to HTML is now done with 'rst2html' command via tox. 2014-02-25 00:43:09 +01:00
Benoît Bryon
2e5d778651 Renamed README to README.rst. Improved setup.py readability. 2013-10-28 18:15:09 +01:00
Benoît Bryon
d21d07c1e7 Refs #26 - Fixed assertIs() compatibility for Python<2.7 2013-05-28 15:21:55 +02:00
Benoît Bryon
121fb4d391 Refs #26 - Do not compute size of virtual files, unless file wrapper implements was_modified_since(). 2013-05-28 15:17:01 +02:00
Benoît Bryon
44f1ca3be3 Refs #35 - Fixed conversion of README from reStructuredText to HTML. 2013-05-28 14:40:46 +02:00
Benoît Bryon
31c0a0f4b9 Refs #34 - Introduced unit tests for DownloadMixin.was_modified_since(). Refactored DownloadMixin: easier to test, better docstrings. 2013-05-14 00:25:30 +02:00