]>
git.ipfire.org Git - thirdparty/starlette.git/log
oTree-org [Mon, 29 Mar 2021 15:02:22 +0000 (23:02 +0800)]
Don't use 'raise exc from None' because it suppresses exception causes (#1158)
Co-authored-by: oTree-org <chris@otree.org>
Mahmoud Hossam [Fri, 12 Mar 2021 12:49:52 +0000 (13:49 +0100)]
Make session cookie use ASGI root path (#1147)
* Make session cookie use ASGI root path
* Check if ASGI root_path exists before using it
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Remove comment
* Add test
Co-authored-by: Mahmoud Hanafy <mahmoud.hanafy@retresco.de>
Co-authored-by: Tom Christie <tom@tomchristie.com>
Jamie Hewland [Sun, 7 Feb 2021 19:06:30 +0000 (19:06 +0000)]
Fix docs syntax highlighting (#1136)
* mkdocs: Use python-markdown-extensions syntax highlighter
* mkdocs: Use 2-space indent consistently in config file
ilunev [Fri, 5 Feb 2021 20:15:25 +0000 (23:15 +0300)]
StaticFiles: Fix cache validation bug for deleted files in html mode (#1023)
* StaticFiles: Fix cache validation bug for deleted files in html mode
Previously StaticFiles would return 304 for a deleted file if its
Last-Modified date was the same as that of 404.html
* Use black formatter
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Jamie Hewland [Fri, 5 Feb 2021 19:13:39 +0000 (19:13 +0000)]
Deprecate built-in GraphQL support (#1135)
* Deprecate GraphQLApp
* Add deprecation warning to pytest ignore list
* Tweak deprecation warnings
Jamie Hewland [Tue, 2 Feb 2021 20:10:02 +0000 (20:10 +0000)]
Version 0.14.2 (#1133)
* Prepare version 0.14.2
* Tweak changelog: Changed -> Fixed
John Bampton [Tue, 2 Feb 2021 11:13:59 +0000 (21:13 +1000)]
Fix spelling (#1115)
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Tim Gates [Tue, 2 Feb 2021 11:09:29 +0000 (22:09 +1100)]
docs: fix simple typo, ougoging -> outgoing (#1120)
There is a small typo in starlette/middleware/gzip.py.
Should read `outgoing` rather than `ougoging`.
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Denis Eliseev [Tue, 2 Feb 2021 11:01:03 +0000 (16:01 +0500)]
Remove self from websocker example app (#1103)
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Vlad Stefan Munteanu [Tue, 2 Feb 2021 10:30:30 +0000 (12:30 +0200)]
Fix functools.partial async handlers for classmethods (#1106)
* Showcase the bug
* Fixed functools.partial usage with classmethods
* Updated comment
* Updated docstring according to suggestion
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Jamie Hewland [Sun, 31 Jan 2021 11:43:07 +0000 (11:43 +0000)]
Fix middleware traceback fetching on Python 3.8+, fix ResourceWarnings in TestClient, fix CI build (#1132)
* Add __init__ file for tests.middleware so Mypy 0.800 is happy
* testclient: Tie loop lifetime to thread
* ServerErrorMiddleware: Don't use undocumented TracebackException.exc_traceback attribute
Roman [Mon, 23 Nov 2020 16:06:26 +0000 (19:06 +0300)]
Add missing status codes (#1096)
Roman [Fri, 20 Nov 2020 09:18:39 +0000 (12:18 +0300)]
Add 208 Already Reported status code (#1095)
Jamie Hewland [Mon, 9 Nov 2020 15:15:31 +0000 (17:15 +0200)]
Version 0.14.1 (#1088)
* Prepare version 0.14.1
* Add link to docs about custom JSON serialization
* Bump release date
* Add link to PR removing UJSONResponse
Jamie Hewland [Sun, 8 Nov 2020 20:49:12 +0000 (22:49 +0200)]
Remove UJSONResponse (#1047)
* Remove UJSONResponse
* Add documentation about custom JSON serialization
Erik [Sun, 8 Nov 2020 19:50:12 +0000 (11:50 -0800)]
Version 0.14.0 (#1087)
* Version 0.14.0 release preparation: write release-notes and version bump.
Vlad Stefan Munteanu [Sun, 8 Nov 2020 01:33:11 +0000 (03:33 +0200)]
Allow usage of functools.partial async handlers (#984)
* Allow usage of async partial methods
* Added test for partial async endpoint
* Double quotes vs single quotes
* Support multiple levels of partials, check Python < 3.8
* Skip coverage for py3.8 branch
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Parzival [Wed, 28 Oct 2020 12:55:53 +0000 (18:40 +0545)]
Update responses.md (#1080)
Small grammar correction.
manuelzander [Thu, 22 Oct 2020 15:15:48 +0000 (16:15 +0100)]
Add 418 I'm A Teapot status code (#1076)
witling [Wed, 21 Oct 2020 18:10:30 +0000 (20:10 +0200)]
fix 793: allow custom async iterator (#1041)
* fix 793
* custom async generator: implement pr notes
* custom async generator: cleanup dependencies
* update tests
* newline at end of tests
* fix linting
* Update tests/test_responses.py
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
* Update tests/test_responses.py
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
* fix naming for custom generator tests
* comply with pep 492
* Shift streaming tests to be in one place
Co-authored-by: witling <noreply@my.email>
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Jeff Astor [Thu, 15 Oct 2020 10:23:52 +0000 (06:23 -0400)]
Friendly spell check in `routing.md` docs. (#1073)
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Moriyoshi Koizumi [Wed, 14 Oct 2020 20:51:28 +0000 (05:51 +0900)]
Add type: ignore for aiofiles to make mypy happier (#1072)
* Add type: ignore to make mypy happier
* Tentatively ignore type checking failure until the following patch gets merged
https://github.com/python/typeshed/pull/4650
Jamie Hewland [Wed, 7 Oct 2020 19:58:59 +0000 (21:58 +0200)]
Test on Python 3.9 (#1068)
* Test on Python 3.9
* Update trove classifiers
Jamie Hewland [Wed, 7 Oct 2020 19:20:55 +0000 (21:20 +0200)]
Create tasks from coroutines before providing to asyncio.wait (#1066)
Andrey Semakin [Fri, 2 Oct 2020 08:53:40 +0000 (13:53 +0500)]
Fix return value of TestClient's __enter__ method (#1064)
Thomas Grainger [Sun, 27 Sep 2020 18:47:51 +0000 (19:47 +0100)]
apply pyupgrade --py36-plus (#1048)
Jamie Hewland [Fri, 11 Sep 2020 13:26:55 +0000 (15:26 +0200)]
Move lifespan tests out of obsolete middleware test module (#1055)
* Move lifespan tests out of obsolete middleware test module
* Add test_lifespan_async
Elliana May [Fri, 11 Sep 2020 11:15:50 +0000 (19:15 +0800)]
Use format_exception instead of format_tb (#1031)
* Use format_exception instead of format_tb
This gives much more information about the exception, including causes, and the exception message itself, in addition to the trackback
* Update test
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Thomas Grainger [Fri, 11 Sep 2020 09:19:47 +0000 (10:19 +0100)]
configure pytest to be stricter (#1040)
* fix tests/test_datastructures::TestUploadFile PytestCollectionWarning
enhance pytest strictness to catch warnings that would have prevented
thest TestUploadFile file warning
restore cov-report and require 100% coverage
* Apply suggestions from code review
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
* remove cov-fail-under
* Apply suggestions from code review
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
* Apply suggestions from code review
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
* Update setup.cfg
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Jamie Hewland [Thu, 10 Sep 2020 19:30:52 +0000 (21:30 +0200)]
Add issue templates (#1054)
Jamie Hewland [Tue, 8 Sep 2020 06:54:55 +0000 (08:54 +0200)]
Run coverage check in CI (#1051)
* Run coverage check in CI
* Use the same step name as httpx
Thomas Grainger [Mon, 7 Sep 2020 07:19:20 +0000 (08:19 +0100)]
allow black to pass on v20.8b1 and v19.10b0 (#1049)
by running black v19.3b0 (we miss you) and then running black v20.8b1
Jamie Hewland [Sun, 6 Sep 2020 10:08:07 +0000 (12:08 +0200)]
Update CI scripts to match httpcore (#1043)
* Update CI scripts to match httpcore
* Run test suite on pushes to master
* Update scripts README
* Don't bother with flake8 extensions for now
* Remove unnecessary PYTHONPATH from build, publish
* test_routing: Use a stub app instead of ellipsis
* Add link to issue about type-checking tests
Jamie Hewland [Sat, 5 Sep 2020 13:16:56 +0000 (15:16 +0200)]
Use and pin black 20 (#1042)
Hannes Küttner [Sun, 16 Aug 2020 14:24:23 +0000 (16:24 +0200)]
Be more lenient with route arguments in AuthencationMiddleware 'requires' decorator (#942)
Erik [Sat, 15 Aug 2020 03:52:58 +0000 (20:52 -0700)]
Install dependencies before attempting to publish. (#1030)
Erik [Fri, 14 Aug 2020 03:48:43 +0000 (20:48 -0700)]
Version 0.13.8 (#1026)
* Version 0.13.8 release
Release notes with following:
- Revert Queue maxsize fix in BaseHTTPMiddleware
- Pathlib Path's now allowed in staticfiles constructor
Erik [Thu, 13 Aug 2020 12:48:18 +0000 (05:48 -0700)]
Remove maxsize arg from Queue constructor in BaseHTTPMiddleware (#1028)
Kevin Stone [Wed, 5 Aug 2020 23:04:07 +0000 (18:04 -0500)]
Use os.PathLike in StaticFiles for directory (#1007)
* Use os.PathLike in StaticFiles for directory
This allows using `pathlib.Path` in addition to `str` for configuring
the base directory of the static files in line with how python3.6+
handles filesystem operations.
Fixes #1004
* Fixed `mimetypes.guess_type` not supporting PathLike on py3.7 and below
* Updated staticfiles documentation with `PathLike` param
Erik [Wed, 5 Aug 2020 15:07:14 +0000 (08:07 -0700)]
Prepare 0.13.7 release: version bump and release-notes (#1020)
Erik [Tue, 4 Aug 2020 23:55:46 +0000 (16:55 -0700)]
Fix high memory usage when using BaseHTTPMiddleware middleware classes and streaming responses (#1018)
* BaseHTTPMiddleware add maxsize arg to Queue constructor
- Limit queue size to 1 to prevent loading entire streaming response into memory
Yaakov Belch [Mon, 27 Jul 2020 10:38:02 +0000 (13:38 +0300)]
DOCUMENTATION -- Correction in websockets.md (#1011)
Correct the exception class from `starlette.websockets.Disconnect` to `starlette.websockets.WebSocketDisconnect`
Dan Trickey [Fri, 24 Jul 2020 10:13:14 +0000 (11:13 +0100)]
Add type annotation to WebSocketEndpoint.encoding (#1003)
* Add type annotation to WebSocketEndpoint.encoding
* Update endpoints.py
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Justin Yo [Fri, 24 Jul 2020 10:11:10 +0000 (19:11 +0900)]
Fixed typo in websocket doc (#1009)
Co-authored-by: YeohJerWei <yeohjerwe@gmail.com>
Tom Christie [Mon, 20 Jul 2020 12:12:23 +0000 (13:12 +0100)]
Version 0.13.6 (#1006)
* Fix staticfiles 404 errors
* Version 0.13.6
Tom Christie [Mon, 20 Jul 2020 12:05:55 +0000 (13:05 +0100)]
Fix staticfiles 404 errors (#1005)
Tom Christie [Fri, 17 Jul 2020 12:41:00 +0000 (13:41 +0100)]
Version 0.13.5 (#1001)
Tom Christie [Thu, 16 Jul 2020 14:18:29 +0000 (15:18 +0100)]
More robust path-traversal check in StaticFiles app (#985)
* More robust path-traversal check in StaticFiles app
* Linting
子休 [Wed, 15 Jul 2020 18:27:17 +0000 (02:27 +0800)]
fix wsgi PATH_INFO encoding (#998)
* fix wsgi PATH_INFO encoding
* encode root_path
* wsgi middleware: Add test for PATH_INFO & SCRIPT_NAME encoding
Co-authored-by: Jamie Hewland <jhewland@gmail.com>
Smart [Wed, 15 Jul 2020 17:29:20 +0000 (14:29 -0300)]
Update testclient.md (#1000)
Fix bad exception name
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Jamie Hewland [Wed, 15 Jul 2020 17:25:59 +0000 (19:25 +0200)]
Use isort v5 (#999)
子休 [Mon, 29 Jun 2020 11:39:10 +0000 (19:39 +0800)]
Add RatelimitMiddleware in docs (#988)
* add RatelimitMiddleware
* empty commit to run test
Co-authored-by: Tom Christie <tom@tomchristie.com>
Vlad Stefan Munteanu [Mon, 29 Jun 2020 11:35:40 +0000 (14:35 +0300)]
Fix hanging graphql tests (#989)
* Use pytest-asyncio event loop when creating AsyncioExecutor in tests
* Reformatting line width
Andrey Sobolev [Wed, 10 Jun 2020 07:50:12 +0000 (10:50 +0300)]
Update third-party-packages.md (#964)
Docs: Add link to ChannelBox in Third party packages
Xu Jing [Mon, 8 Jun 2020 13:33:35 +0000 (09:33 -0400)]
fix(comment typo): (#959)
Thanks!
W [Mon, 1 Jun 2020 10:31:04 +0000 (18:31 +0800)]
Allow render to access status code (#938)
* Allow render to access status code
Minor change the sequence for init status and body, so render can access status code
* Move render before ini_headers
Denzil Francis Crasta [Sat, 30 May 2020 07:08:48 +0000 (12:38 +0530)]
add missing word 'as' in the docstring for Starlette (#958)
Kevin Tewouda [Thu, 28 May 2020 13:11:22 +0000 (15:11 +0200)]
Fixed typos in documentation (#956)
Co-authored-by: le_woudar <kevin.tewouda@gandi.net>
Bartek Ciszkowski [Fri, 15 May 2020 07:42:12 +0000 (03:42 -0400)]
RedirectResponse now accepts optional background parameter (#945)
* RedirectResponse now accepts optional background parameter
With this change, a `background` task can now be sent during a
RedirectResponse.
This can be useful when an application wishes to run a background task
after a form submission, which usually includes a redirect (e.g. to
prevent resubmission)
Closes #941
* Revert testing background in redirect test
Peer Sommerlund [Mon, 11 May 2020 11:22:59 +0000 (13:22 +0200)]
Allow path to contain regex meta characters (#932)
* Allow path to contain regex meta characters
euri10 [Thu, 7 May 2020 12:50:24 +0000 (14:50 +0200)]
Middleware should treat `body` in response ASGI messages as an optional key. (#935)
* Failing test for HEAD method when using a middleware
* Fixed by sending empty body if send_header_only
* Lint
* Respect asgi spec
* Be explicit in case we send headers only
云中君 [Wed, 6 May 2020 13:52:26 +0000 (21:52 +0800)]
Thread pool is no longer used for files in memory (#933)
* https://github.com/Tinche/aiofiles/issues/47
Thread pool is no longer used for files in memory
* fix tests
* fix import sorted
* little change
Tom Christie [Mon, 4 May 2020 10:31:54 +0000 (11:31 +0100)]
Support generator function to manage startup/shutdown. (#799)
* Refactor lifespan to run as an async generator
* Add 'lifespan' argument
* Add 'app' argument to lifespan handler function
* Support either sync or async generators as the app 'lifespan' callable
Piotr Staroszczyk [Mon, 4 May 2020 10:13:45 +0000 (12:13 +0200)]
Requires decorator redirects with 303 status_code instead of 307 #927 (#929)
Tom Christie [Thu, 30 Apr 2020 09:26:17 +0000 (10:26 +0100)]
Update publish (#923)
Include PYTHONPATH so that auto docs can import from the package correctly.
Tom Christie [Thu, 30 Apr 2020 08:48:57 +0000 (09:48 +0100)]
Version 0.13.4 (#922)
* Add publish workflow
* Version 0.13.4
Tom Christie [Wed, 29 Apr 2020 14:48:44 +0000 (15:48 +0100)]
Add publish workflow (#921)
Rene Dohmen [Tue, 28 Apr 2020 12:33:48 +0000 (14:33 +0200)]
Added StarletteOpentracing to the third party middleware docs (#918)
Bartek Ciszkowski [Tue, 28 Apr 2020 08:36:14 +0000 (04:36 -0400)]
Docs: Update database migration instructions (#916)
Expand the database documentation to introduce the user to the migration
process without going too deep into Alembic. Helps complete the example
presented on the page
Jamie Hewland [Fri, 24 Apr 2020 09:27:34 +0000 (11:27 +0200)]
Check isort in CI (#913)
* Check isort in CI
* Fix incorrectly sorted imports
Tom Christie [Thu, 23 Apr 2020 15:13:33 +0000 (16:13 +0100)]
Delete .codecov.yml
Tom Christie [Thu, 23 Apr 2020 15:10:50 +0000 (16:10 +0100)]
Update index.md
Tom Christie [Thu, 23 Apr 2020 15:10:29 +0000 (16:10 +0100)]
Update README.md
Tom Christie [Thu, 23 Apr 2020 15:09:14 +0000 (16:09 +0100)]
Update index.md
Tom Christie [Thu, 23 Apr 2020 15:07:13 +0000 (16:07 +0100)]
Update README.md
Tom Christie [Thu, 23 Apr 2020 15:05:05 +0000 (16:05 +0100)]
github-actions-for-ci (#911)
Erik [Thu, 23 Apr 2020 08:32:45 +0000 (01:32 -0700)]
Switch to a more lenient cookie parsing method (#900)
* ADd failing test representing cookie parsing failing
* Add tests inspired by tornado test suite
* Modify requests.cookies to utilize new cookie parsing strategy
Derek Bekoe [Wed, 22 Apr 2020 10:42:14 +0000 (03:42 -0700)]
Docs: Update middleware.md - CORS max_age 600 (#909)
Update max_age documentation from 60 to the actual default value of 600.
https://github.com/encode/starlette/blob/master/starlette/middleware/cors.py#L23
Jamie Hewland [Tue, 21 Apr 2020 18:24:55 +0000 (20:24 +0200)]
Add a UUID convertor (#903)
* Implement UUID path param converter
* Add the uuid convertor to the docs
Tom Christie [Wed, 15 Apr 2020 11:20:51 +0000 (12:20 +0100)]
Version 0.13.3 (#899)
* Version 0.13.3
* Linting
Chris Withers [Wed, 15 Apr 2020 08:46:46 +0000 (10:46 +0200)]
allow exceptions in middleware to surface when using TestClient (#888)
Tony Benoy [Tue, 14 Apr 2020 09:23:46 +0000 (14:53 +0530)]
MANIFEST.ini (#895)
* MANIFEST.ini
* added excludes
* Update MANIFEST.in
Co-authored-by: Tom Christie <tom@tomchristie.com>
Tom Christie [Fri, 27 Mar 2020 17:51:54 +0000 (17:51 +0000)]
Merge pull request #881 from florimondmanca/fix-cors
Fix safelisted CORS headers implementation
florimondmanca [Fri, 27 Mar 2020 17:14:05 +0000 (18:14 +0100)]
Fix safelisted CORS headers implementation
Tom Christie [Fri, 27 Mar 2020 16:51:09 +0000 (16:51 +0000)]
Update cors.py
Tom Christie [Fri, 27 Mar 2020 15:51:41 +0000 (15:51 +0000)]
Merge pull request #880 from vgerak/master
Add safelisted request headers to CORSMiddleware
Vasilis Gerakaris [Fri, 27 Mar 2020 15:02:28 +0000 (17:02 +0200)]
Add safelisted request headers to CORSMiddleware
See https://fetch.spec.whatwg.org/#cors-safelisted-request-header
Tom Christie [Thu, 26 Mar 2020 13:51:34 +0000 (13:51 +0000)]
Delete CONTRIBUTING.md
George Bogodukhov [Sat, 21 Mar 2020 08:56:02 +0000 (19:26 +1030)]
Merge pull request #867 from aviramha/master
Ignore malformed cookie
Aviram Hassan [Wed, 18 Mar 2020 08:33:30 +0000 (10:33 +0200)]
Update tests/test_requests.py
@florimondmanca better test
Co-Authored-By: Florimond Manca <florimond.manca@gmail.com>
Aviram Hassan [Wed, 18 Mar 2020 07:41:08 +0000 (09:41 +0200)]
ignore malformed cookie instead of raising an exception
Tom Christie [Mon, 16 Mar 2020 11:17:18 +0000 (11:17 +0000)]
More detail on how to use convertors (#862)
It wasn't immediately clear to me how to use them.
Simon Willison [Sun, 15 Mar 2020 00:51:50 +0000 (17:51 -0700)]
More detail on how to use convertors
It wasn't immediately clear to me how to use them.
ppd0705 [Tue, 10 Mar 2020 09:24:12 +0000 (17:24 +0800)]
Fix middleware repr (#858)
* Fix middleware repr
* Fix middleware base test
Aaron Mangum [Wed, 4 Mar 2020 11:07:54 +0000 (03:07 -0800)]
fix mypy failing with Mount and routes parameter (#853)
Currently, mypy fails with the following error when Starlette is initialized with a mount in routes.
```
app = Starlette(
routes=[
Mount('api', routes=routes)
]
)
```
mypy fails with the following:
```
app/main.py:24: error: Argument "routes" to "Mount" has incompatible type "List[Route]"; expected "Optional[List[BaseRoute]]"
app/main.py:24: note: "List" is invariant -- see http://mypy.readthedocs.io/en/latest/common_issues.html#variance
app/main.py:24: note: Consider using "Sequence" instead, which is covariant
```
This change also brings `Mount` types into alignment with `Router`
sysid [Mon, 2 Mar 2020 10:12:37 +0000 (11:12 +0100)]
feat: documentation for 3rd party response types: SSEResponse (#852)
Kamforka [Wed, 26 Feb 2020 13:15:47 +0000 (14:15 +0100)]
Add listener task to cancel streaming response in case of an early disconnect (#839)
* Add listener task to cancel streaming response in case of an early disconnect
* Use run_until_first_complete instead of custom wait
* Remove unused import
Jeff Astor [Tue, 25 Feb 2020 15:11:38 +0000 (10:11 -0500)]
Friendly spellcheck in convertor assertion (#845)
Daniel Hedrén [Tue, 25 Feb 2020 12:27:15 +0000 (13:27 +0100)]
SameSite support for cookies (#732)
* Add samesite support to cookies
* Cleanup
Remove unnecessary import and str()
* SameSite "lax" default, enforce valid options
* Update signature
Alessandro Ogier [Thu, 20 Feb 2020 21:43:37 +0000 (22:43 +0100)]
adding authlib middleware (#841)