]>
git.ipfire.org Git - thirdparty/starlette.git/log
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)
Tom Christie [Thu, 20 Feb 2020 15:43:03 +0000 (15:43 +0000)]
Websocket iter (#838)
* Add iter_text, iter_bytes, iter_json to WebSocket
* Add run_until_first_complete for weksocket sender/receiver branching
Tom Christie [Thu, 20 Feb 2020 13:03:20 +0000 (13:03 +0000)]
Add iter_text, iter_bytes, iter_json to WebSocket (#837)
Tom Christie [Wed, 19 Feb 2020 10:37:43 +0000 (10:37 +0000)]
Add chat to docs (#834)
Colin Bounouar [Wed, 19 Feb 2020 10:37:21 +0000 (11:37 +0100)]
Ensure pyyaml is installed before actually using it (#833)
* Ensure pyyaml is installed before actually using it
* Remove assertion raising test case
Colin Bounouar [Wed, 19 Feb 2020 09:53:11 +0000 (10:53 +0100)]
Link to black GitHub repository (#832)
Eugene Molotov [Mon, 17 Feb 2020 14:14:30 +0000 (19:14 +0500)]
Allow non latin-1 filename in FileResponse (#792)
Yang Keming [Fri, 14 Feb 2020 09:18:42 +0000 (17:18 +0800)]
fix doc: endpoint websocket example (#827)
retnikt [Tue, 11 Feb 2020 09:36:29 +0000 (09:36 +0000)]
More debugger improvements (#825)
* HTML-escape everything in the debugger
There isn't much of an attack surface here given the debugger should never be
exposed in production and most of these things are not user-controllable (in
fact you'd have to try hard to get `<script>` in a Python identifier), but
escaping them is still important in case they mess up debugger output (see #599,
#601), and it's also just good practice.
* monospace debugger content and clean up styles
Bo Huang [Mon, 10 Feb 2020 14:53:22 +0000 (09:53 -0500)]
Allow callable functions to be passed into the config's casting (#530)
parameter
retnikt [Mon, 10 Feb 2020 12:25:05 +0000 (12:25 +0000)]
fix naive debugger line numbers in ServerErrorMiddleware (#821)
Previously the error middleware in debug mode would naively calculate the line
numbers without knowledge of the position in the file. This meant that if the
exception occurred near the top or bottom of the file, the line numbers and
the highlighted line would be incorrect. The named tuple returned by
`inspect.getinnerframes` contains an `index` field which is not naive and will
result in correct line numbers. This change also simplifies the code somewhat
Daniel [Tue, 4 Feb 2020 14:14:53 +0000 (15:14 +0100)]
Fix typo (#816)
Tom Christie [Thu, 30 Jan 2020 11:40:55 +0000 (11:40 +0000)]
Version 0.13.1 (#815)
Jorge Leitao [Wed, 29 Jan 2020 15:51:25 +0000 (16:51 +0100)]
Added 3rd party package. (#768)
Co-authored-by: Tom Christie <tom@tomchristie.com>
Tom Christie [Wed, 29 Jan 2020 11:15:38 +0000 (11:15 +0000)]
WSGI middleware should lowercase ASGI headers (#813)
Tom Christie [Wed, 29 Jan 2020 09:48:35 +0000 (09:48 +0000)]
Fix slash redirects (#812)
* Fix for slash redirects
* Drop extranous 'type: ignore'
* Drop print() statement
* Add type: ignore on optional imports
Bekhzod Tillakhanov [Thu, 23 Jan 2020 09:24:39 +0000 (14:24 +0500)]
docs(database): change gino homepage url (#808)
Change homepage url gino from `https://python-gino.readthedocs.io/en/latest/` to `https://python-gino.org/`
Joseph Buckley [Wed, 15 Jan 2020 10:55:10 +0000 (02:55 -0800)]
Security patch: Updating CORS origin regex to use a full regex match (#801)
* Updating CORS origin regex to use a full regex match
* Reformatting unittest based on linting
Vlad Dmitrievich [Thu, 9 Jan 2020 15:11:28 +0000 (17:11 +0200)]
typo in configuration docs (#789)
Daniel Hahler [Tue, 7 Jan 2020 14:00:10 +0000 (15:00 +0100)]
typing: remove unused "type: ignore" comments (#779)
* typing: remove unused "type: ignore" comments
Found via:
> mypy --warn-unused-ignores --ignore-missing-imports starlette
Using:
> mypy 0.770+dev.
cdd91ba819646b0138b05a8e9180faba4ef0ff92 .dirty
* fixup! typing: remove unused "type: ignore" comments
Daniel Hahler [Tue, 7 Jan 2020 09:40:30 +0000 (10:40 +0100)]
ci: Travis: use py38 (#781)
Yang Keming [Mon, 6 Jan 2020 10:48:20 +0000 (18:48 +0800)]
update 3rd packages: add spectree (#783)
Tomasz Wójcik [Sun, 29 Dec 2019 15:11:12 +0000 (16:11 +0100)]
add starlette-context to 'third party packages' docs (encode#420) (#770)
Emil Stenström [Sat, 21 Dec 2019 21:49:27 +0000 (22:49 +0100)]
Add space so example is copy-pastable (#766)
Tom Christie [Tue, 17 Dec 2019 11:14:57 +0000 (11:14 +0000)]
Ignore gnarly type check in WSGI implementation (#756)
* Ignore gnarly type check in WSGI implementation
* Linting
Trim21 [Tue, 17 Dec 2019 09:57:02 +0000 (17:57 +0800)]
support Path in Config (#755)
* support Path in Config
* fix broken tests
podhmo [Mon, 16 Dec 2019 16:58:33 +0000 (01:58 +0900)]
add import Route (#752)
Eneko Illarramendi [Tue, 10 Dec 2019 14:58:44 +0000 (15:58 +0100)]
Document custom filters for Jinja2 (#737)
Tom Christie [Mon, 25 Nov 2019 09:13:12 +0000 (09:13 +0000)]
Update database.md
Tom Christie [Fri, 22 Nov 2019 11:28:12 +0000 (11:28 +0000)]
Update routing.md
Fulvio Esposito [Fri, 22 Nov 2019 11:26:14 +0000 (12:26 +0100)]
Drop double square brackets tests in install script (#718)
sh doesn't support double square brackets tests which are a bash feature.
This commit replace them with single square brackets tests
Jake Howard [Fri, 22 Nov 2019 11:22:15 +0000 (11:22 +0000)]
Show nicer warning when `ujson` isn't installed (#728)
Tom Christie [Wed, 20 Nov 2019 15:10:15 +0000 (15:10 +0000)]
Tweak app signatures (#723)
Florian Apolloner [Fri, 15 Nov 2019 12:06:59 +0000 (13:06 +0100)]
Added support for publishing wheel files. Fixes #668 (#719)
Jeff Triplett [Wed, 13 Nov 2019 18:56:47 +0000 (12:56 -0600)]
:pencil: Fixes example typo in README (#717)
Thanks!
Tom Christie [Wed, 13 Nov 2019 12:27:50 +0000 (12:27 +0000)]
Version 0.13.0