Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defaults ws max_size on server to 16MB #538

Closed
wants to merge 131 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
90a59ab
Defaults ws max_size on server to 16MB
euri10 Dec 20, 2019
e10829e
Renamed test
euri10 Dec 20, 2019
75e70dc
Lint
euri10 Dec 20, 2019
8cb0b05
Lint 2
euri10 Dec 20, 2019
940080b
Merge branch 'master' into websocket_max_message_size
tomchristie May 13, 2020
d39a2c2
Merge branch 'master' into websocket_max_message_size
euri10 May 19, 2020
ebc0d25
Renamed to ws_max_size
euri10 May 19, 2020
f131cf2
Added test for Config
euri10 May 19, 2020
285da7d
Added click option
euri10 May 19, 2020
509e313
Flake8
euri10 May 19, 2020
b83d625
Updated docs in deployment
euri10 May 19, 2020
a695450
Updated docs in index
euri10 May 19, 2020
49e7e6c
Added usage note in settings.md
euri10 May 19, 2020
9b92925
Document default backlog setting (#682)
ipmb May 27, 2020
77468df
Add --app-dir option for running uvicorn from any location (#619)
yezyilomo Jun 9, 2020
6757386
Removing iocp mentions from documentation (#692)
Bloodielie Jun 10, 2020
f623916
Release version 0.11.6 (#705)
tiangolo Jul 17, 2020
81f2136
Brings back windows testing to CI (#685)
euri10 Jul 24, 2020
789e2f1
Disallow invalid header characters (#725)
tomchristie Jul 28, 2020
895807f
Quote path component before logging (#724)
tomchristie Jul 28, 2020
a796e1d
Corrected --proxy-headers client ip/host when using a unix socket (#636)
euri10 Jul 28, 2020
178bee6
Version 0.11.7 (#726)
tomchristie Jul 28, 2020
7163e95
Update CHANGELOG.md
tomchristie Jul 29, 2020
0380c4e
Fix crash when --interface is wsgi (#730)
mpaolini Jul 30, 2020
8f35b6d
Update 0.11.7 changelog (#732)
florimondmanca Jul 30, 2020
918722a
Get the request.client under case uvicorn is run with a fd or a unix …
euri10 Jul 31, 2020
4597b90
Version 0.11.8 (#731)
florimondmanca Jul 31, 2020
0abbb6b
Added Isuue template based on the one from httpx (#735)
euri10 Jul 31, 2020
52e1bf4
Move the dir (#737)
euri10 Aug 4, 2020
e77e596
Align most of scripts of httpx here (#739)
euri10 Aug 6, 2020
11f9a71
Install script back to where it was and same as httpx (#746)
euri10 Aug 6, 2020
5fa99a1
Use optional package installs (#666)
euri10 Aug 10, 2020
a9c37cc
Fixes bug where --log-config disables uvicorn loggers (#512)
petermorrowdev Aug 11, 2020
fbce393
Upgrade wsproto to 0.15.0 (#750)
euri10 Aug 13, 2020
8150c3e
Added asgi dict to the lifespan scope (#754)
euri10 Aug 15, 2020
a9a46e8
Mypy lifespan (#751)
euri10 Aug 16, 2020
093a1f7
Allow .json or .yaml --log-config files (#665)
jcwilson Aug 18, 2020
dd3b842
Fix terminate error in windows (#744)
abersheeran Aug 27, 2020
aa046f5
Black 20 is the new black (#769)
euri10 Aug 27, 2020
2e22b85
Drop deprecated isort-seed-config (#770)
euri10 Aug 27, 2020
b782588
chore: add config for pointing to Gitter chat (#768)
Midnighter Aug 27, 2020
df81b16
Dont set log level for root logger (#767)
kigawas Aug 28, 2020
ff4af12
Revert "Improve shutdown robustness when using `--reload` or multipro…
euri10 Aug 28, 2020
54d729c
Upgrade maximum h11 dependency version to 0.10 (#772)
Aug 28, 2020
9801002
Make reload delay configurable (#774)
rafalp Sep 28, 2020
342c68d
Version 0.12.0 (#771)
euri10 Sep 28, 2020
d5fa9d8
Move package editable install to requirements.txt (#790)
florimondmanca Sep 29, 2020
70ebcfd
Get docs/index.md in sync with README.md (#784)
graingert Sep 29, 2020
bbf19c6
Pinning h11 and python-dotenv to min versions (#789)
euri10 Sep 29, 2020
e2b7506
Improve changelog by pointing out breaking changes (#792)
vikahl Sep 29, 2020
cd00516
Version 0.12.1 (#794)
euri10 Sep 30, 2020
a504c56
Note the need to configure trusted "ips" when using unix sockets (#796)
PeterJCLaw Oct 4, 2020
08fd055
Added python 3.9 support (#804)
euri10 Oct 6, 2020
b468950
Support .yml log config files (#799)
mrakitin Oct 6, 2020
d755fe8
Drop pytest-cov and uses vanilla coverage (#809)
euri10 Oct 8, 2020
103167a
Sharing socket across workers on windows (#802)
euri10 Oct 12, 2020
6873289
Added cli suport for headers containing colon (#813)
romulocollopy Oct 12, 2020
23d274d
Refactor ssl tooling using trustme (#807)
euri10 Oct 12, 2020
90dbb6e
Adding ability to decrypt ssl key file (#808)
euri10 Oct 12, 2020
5acaee5
Fix reload with ipv6 host (#803)
euri10 Oct 14, 2020
1b32f99
Fixes watchgod with common prefixes (#817)
Roang-zero1 Oct 14, 2020
c592c7b
Changed test_config fixture scope, which fixes some config tests (#821)
cdeler Oct 19, 2020
cca3c3e
v0.12.2 (#823)
euri10 Oct 19, 2020
d5614f6
[Docs] Fix mkdocs warning + Added Permalinks (#826)
Vibhu-Agarwal Oct 21, 2020
d78394e
Fix server not running with explicit hostname (#827)
euri10 Oct 22, 2020
ef80625
Add reload test base class (#833)
Roang-zero1 Oct 26, 2020
d5dcf80
Cancel old keepalive-trigger before setting new one. (#832)
cdeler Oct 26, 2020
6468b70
Documentation: HTTPS settings add missing --ssl-keyfile-password (#839)
remster85 Nov 2, 2020
bdab488
Rework IPv6 support (#837)
florimondmanca Nov 8, 2020
634aec9
Isolate server code into an asyncio-specific module (#842)
florimondmanca Nov 8, 2020
45322cc
Fix protocol not imported directly (#838)
euri10 Nov 9, 2020
45e6e83
Use latin1 when decoding X-Forwarded-* headers (#701)
tristan Nov 12, 2020
de21361
Fix race condition that leads Quart to hang with uvicorn (#848)
euri10 Nov 18, 2020
79a72e3
Modernize test ASGI applications (#854)
florimondmanca Nov 18, 2020
0b941ab
v0.12.3 (#862)
euri10 Nov 22, 2020
16d12f3
Fix typo in settings documentation (#864)
mxsasha Nov 24, 2020
f1bcade
Move server implementation to server.py (#866)
florimondmanca Nov 25, 2020
ce2ef45
Skip installation of signal handlers when not in main thread (#871)
florimondmanca Dec 7, 2020
50fc0d1
Add --factory flag to support factory-style application imports (#875)
florimondmanca Dec 7, 2020
41a8be4
Version 0.13.0 (#874)
florimondmanca Dec 8, 2020
1b36d69
Fix release date of 0.13.0 (#878)
florimondmanca Dec 9, 2020
5311e11
Add tool to keep CLI usage in `index.md` in sync (#876)
florimondmanca Dec 9, 2020
0660e74
Removed extra kwrgs from access logging to avoid scope > headers leak…
euri10 Dec 9, 2020
8581b34
Fix recv() errors when closed during handshake (#704)
adamhooper Dec 9, 2020
9a3040c
Ensure that ws connection is open before receiving data (#881)
euri10 Dec 9, 2020
a227f17
Fix logger after scope removal (#884)
euri10 Dec 12, 2020
1f282e0
Version 0.13.1 (#880)
florimondmanca Dec 12, 2020
305ed0e
Log exception traceback in case of invalid HTTP request when using ht…
florimondmanca Dec 12, 2020
5512965
Increase coverage by testing for an invalid http request (#857)
euri10 Dec 12, 2020
2e17dd9
Log exception traceback in case of invalid HTTP request when using h1…
florimondmanca Dec 12, 2020
5e8a888
Add extra invalid HTTP request test cases (#888)
florimondmanca Dec 12, 2020
058234f
adds BlackSheep to the list of ASGI web frameworks (#891)
RobertoPrevato Dec 13, 2020
debdb64
Brings lifespan to 100% coverage (#897)
euri10 Dec 17, 2020
1841655
Config coverage upgrade (#898)
euri10 Dec 19, 2020
cdb6873
Test config should_reload property (#899)
euri10 Dec 19, 2020
73d6f09
Release 0.13.2 (#890)
florimondmanca Dec 19, 2020
7a667a5
Bump version in __init__.py (#905)
florimondmanca Dec 20, 2020
e01c927
Small coverage increase in protocols/utils (#904)
euri10 Dec 22, 2020
39b3903
Fix docs about reloader (#907)
euri10 Dec 22, 2020
49c0a55
Added docs example to tweak gunicorn worker config (#908)
euri10 Dec 23, 2020
f8dd9fb
Fix lifespan tests (#913)
florimondmanca Dec 26, 2020
afb2d56
Tweak detection of app factories (#914)
florimondmanca Dec 26, 2020
28f5d2b
Make setup.py PEP440 compliant. (#916)
itsayellow Dec 27, 2020
c6b80fc
remove redundant transform list -> list (#909)
SergBobrovsky Dec 27, 2020
70ec20f
Test suite refactor using async server context manager instead of bac…
euri10 Dec 28, 2020
091571b
Fixes websockets implementation where handshake fails left tasks pend…
euri10 Dec 29, 2020
36cfe87
🐛 Fix resetting signals in Gunicorn UvicornWorker (#895)
tiangolo Dec 29, 2020
c4c7600
Add docs script (#923)
florimondmanca Dec 29, 2020
fa914bc
Version 0.13.3 (#922)
florimondmanca Dec 29, 2020
3da100f
Use ssl verification in tests (#928)
euri10 Dec 29, 2020
a67ac86
Remove requests dependency (#918)
euri10 Dec 29, 2020
db4683f
Enabled permessage-deflate extension in websockets (#764)
kmichel2 Jan 1, 2021
320fd6d
Isolate server started message (#930)
florimondmanca Jan 3, 2021
bd1a096
Return 'connection: close' header in response (#721)
RmStorm Jan 25, 2021
61a6cab
Document the default value of 1 for workers (#940) (#943)
pawamoy Jan 25, 2021
cf0b051
Relax watchgod up bound (#946)
euri10 Jan 31, 2021
1291b5d
Docs: Nginx + websockets (#948)
JoseKilo Feb 10, 2021
bf7dac3
fix: pin uvloop to the lastest Python 3.6 supported version (#952)
Kludex Feb 10, 2021
9d51e1c
unpin uvloop (#959)
graingert Feb 20, 2021
2b1a67f
Fix wsgi middleware PATH_INFO encoding (#962)
CoolSpring8 Feb 20, 2021
2a7634d
version 0.13.4 (#958)
euri10 Feb 20, 2021
d716ad0
Support 'reason' field in 'websocket.close' messages (#957)
michallowasrzechonek-silvair Feb 24, 2021
0a35a50
Implemented lifespan.shutdown.failed (#755)
euri10 Feb 25, 2021
9dc5a43
Up wsproto to 1.0.0 (#892)
euri10 Feb 25, 2021
942deb9
Improve user feedback if no ws library installed (#926)
euri10 Feb 25, 2021
83303ff
Prevent garbage collection of main lifespan task (#972)
MatthewScholefield Mar 4, 2021
d5d62d4
Fix socket port 0 (#975)
euri10 Mar 5, 2021
1e3eb1e
tests: add log coverage on lifespan failed shutdown event (#981)
Kludex Mar 8, 2021
8967888
tests: add ssl coverage (#982)
Kludex Mar 8, 2021
0cddc85
Merge branch 'websocket_max_message_size' of https://github.com/euri1…
euri10 Mar 9, 2021
b9a7126
Test with new test run_server
euri10 Mar 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .codecov.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/2-bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Bug report
about: Report a bug to help improve this project
---

### Checklist

<!-- Please make sure you check all these items before submitting your bug report. -->

- [ ] The bug is reproducible against the latest release and/or `master`.
- [ ] There are no similar issues or pull requests to fix it yet.

### Describe the bug

<!-- A clear and concise description of what the bug is. -->

### To reproduce

<!-- Provide a *minimal* example with steps to reproduce the bug locally.

NOTE: try to keep any external dependencies *at an absolute minimum* .
In other words, remove anything that doesn't make the bug go away.

-->

### Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

### Actual behavior

<!-- A clear and concise description of what actually happens. -->

### Debugging material

<!-- Any tracebacks, screenshots, etc. that can help understanding the problem.

NOTE:
- Please list tracebacks in full (don't truncate them).
- If relevant, consider turning on DEBUG or TRACE logs for additional details (see the Logging section on https://www.uvicorn.org/settings/ specifically the `log-level` flag).
- Consider using `<details>` to make tracebacks/logs collapsible if they're very large (see https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d).
-->

### Environment

- OS / Python / Uvicorn version: just run `uvicorn --version`
- The exact command you're running uvicorn with, all flags you passed included. If you run it with gunicorn please do the same. If there is a reverse-proxy involved and you cannot reproduce without it please give the minimal config of it to reproduce.

### Additional context

<!-- Any additional information that can help understanding the problem.

Eg. linked issues, or a description of what you were trying to achieve. -->
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/3-feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Feature request
about: Suggest an idea for this project.
---

### Checklist

<!-- Please make sure you check all these items before submitting your feature request. -->

- [ ] There are no similar issues or pull requests for this yet.
- [ ] I discussed this idea on the [community chat](https://gitter.im/encode/community) and feedback is positive.

### Is your feature related to a problem? Please describe.

<!-- A clear and concise description of what you are trying to achieve.

Eg "I want to be able to [...] but I can't because [...]". -->

## Describe the solution you would like.

<!-- A clear and concise description of what you would want to happen.

For API changes, try to provide a code snippet of what you would like the API to look like.
-->

## Describe alternatives you considered

<!-- Please describe any alternative solutions or features you've considered to solve
your problem and why they wouldn't solve it. -->

## Additional context

<!-- Provide any additional context, screenshots, tracebacks, etc. about the feature here. -->
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: true
contact_links:
- name: Question
url: https://gitter.im/encode/community
about: >
Ask a question
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ jobs:

steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
- uses: "actions/setup-python@v2"
with:
python-version: 3.7
- name: "Publish"
- name: "Install dependencies"
run: "scripts/install"
- name: "Build package & docs"
run: "scripts/build"
- name: "Publish to PyPI & deploy docs"
run: "scripts/publish"
env:
TWINE_USERNAME: __token__
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,29 @@ on:

jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"

name: "Python ${{ matrix.python-version }} ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8"]

python-version: ["3.6", "3.7", "3.8", "3.9"]
os: [windows-latest, ubuntu-latest]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: "scripts/install"
shell: bash
- name: "Run linting checks"
run: "scripts/check"
shell: bash
- name: "Build package & docs"
run: "scripts/build"
shell: bash
- name: "Run tests"
run: "scripts/test"
shell: bash
- name: "Enforce coverage"
run: "scripts/coverage"
shell: bash
110 changes: 110 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,115 @@
# Change Log

## 0.13.4 - 2021-02-20

### Fixed

- Fixed wsgi middleware PATH_INFO encoding (#962) 2/20/21
- Fixed uvloop dependency (#952) 2/10/21 then (#959) 2/20/21
- Relax watchgod up bound (#946) 1/31/21
- Return 'connection: close' header in response (#721) 1/25/21

### Added:

- Docs: Nginx + websockets (#948) 2/10/21
- Document the default value of 1 for workers (#940) (#943) 1/25/21
- Enabled permessage-deflate extension in websockets (#764) 1/1/21

## 0.13.3 - 2020-12-29

### Fixed

- Prevent swallowing of return codes from `subprocess` when running with Gunicorn by properly resetting signals. (Pull #895)
- Tweak detection of app factories to be more robust. A warning is now logged when passing a factory without the `--factory` flag. (Pull #914)
- Properly clean tasks when handshake is aborted when running with `--ws websockets`. (Pull #921)

## 0.13.2 - 2020-12-12

### Fixed

- Log full exception traceback in case of invalid HTTP request. (Pull #886 and #888)

## 0.13.1 - 2020-12-12

### Fixed

- Prevent exceptions when the ASGI application rejects a connection during the WebSocket handshake, when running on both `--ws wsproto` or `--ws websockets`. (Pull #704 and #881)
- Ensure connection `scope` doesn't leak in logs when using JSON log formatters. (Pull #859 and #884)

## 0.13.0 - 2020-12-08

### Added

- Add `--factory` flag to support factory-style application imports. (#875) 2020-12-07 50fc0d1c
- Skip installation of signal handlers when not in the main thread. Allows using `Server` in multithreaded contexts without having to override `.install_signal_handlers()`. (#871) 2020-12-07 ce2ef45a

## 0.12.3 - 2020-11-21

### Fixed
- Fix race condition that leads Quart to hang with uvicorn (#848) 11/18/20 de213614
- Use latin1 when decoding X-Forwarded-* headers (#701) 11/12/20 45e6e831
- Rework IPv6 support (#837) 11/8/20 bdab488e
- Cancel old keepalive-trigger before setting new one. (#832) 10/26/20 d5dcf80c

## 0.12.2 - 2020-10-19

### Added
- Adding ability to decrypt ssl key file (#808) 10/12/20 90dbb6e0
- Support .yml log config files (#799) 10/6/20 b468950e
- Added python 3.9 support (#804) 10/6/20 08fd0559

### Fixed
- Fixes watchgod with common prefixes (#817) 10/14/20 1b32f997
- Fix reload with ipv6 host (#803) 10/14/20 5acaee5b
- Added cli suport for headers containing colon (#813) 10/12/20 68732899
- Sharing socket across workers on windows (#802) 10/12/20 103167a0
- Note the need to configure trusted "ips" when using unix sockets (#796) 10/4/20 a504c569

## 0.12.1 - 2020-09-30

### Changed
- Pinning h11 and python-dotenv to min versions (#789) 9/29/20 bbf19c66
- Get docs/index.md in sync with README.md (#784) 9/29/20 70ebcfdf

### Fixed
- Improve changelog by pointing out breaking changes (#792) 9/29/20 e2b75064

## 0.12.0 - 2020-09-28

### Added
- Make reload delay configurable (#774) 9/28/20 98010027
- Upgrade maximum h11 dependency version to 0.10 (#772) 8/28/20 54d729cc
- Allow .json or .yaml --log-config files (#665) 8/18/20 093a1f7c
- Add ASGI dict to the lifespan scope (#754) 8/15/20 8150c3eb
- Upgrade wsproto to 0.15.0 (#750) 8/13/20 fbce393f
- Use optional package installs (#666) 8/10/20 5fa99a11

### Changed
- Dont set log level for root logger (#767) 8/28/20 df81b168
- Uvicorn no longer ships extra dependencies `uvloop`, `websockets` and
`httptools` as default. To install these dependencies use
`uvicorn[standard]`.

### Fixed
- Revert "Improve shutdown robustness when using `--reload` or multiprocessing (#620)" (#756) 8/28/20 ff4af12d
- Fix terminate error in windows (#744) 8/27/20 dd3b842d
- Fix bug where --log-config disables uvicorn loggers (#512) 8/11/20 a9c37cc4

## 0.11.8 - 2020-07-30

* Fix a regression that caused Uvicorn to crash when using `--interface=wsgi`. (Pull #730)
* Fix a regression that caused Uvicorn to crash when using unix domain sockets. (Pull #729)

## 0.11.7 - 2020-28-07

* SECURITY FIX: Prevent sending invalid HTTP header names and values. (Pull #725)
* SECURITY FIX: Ensure path value is escaped before logging to the console. (Pull #724)
* Fix `--proxy-headers` client IP and host when using a Unix socket. (Pull #636)

## 0.11.6

* Fix overriding the root logger.

## 0.11.5

* Revert "Watch all files, not just .py" due to unexpected side effects.
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ Install using `pip`:
$ pip install uvicorn
```

This will install uvicorn with minimal (pure Python) dependencies.

```shell
$ pip install uvicorn[standard]
```

This will install uvicorn with "Cython-based" dependencies (where possible) and other "optional extras".

In this context, "Cython-based" means the following:

- the event loop `uvloop` will be installed and used if possible.
- the http protocol will be handled by `httptools` if possible.

Moreover, "optional extras" means that:

- the websocket protocol will be handled by `websockets` (should you want to use `wsproto` you'd need to install it manually) if possible.
- the `--reloader` flag in development mode will use `watchgod`.
- windows users will have `colorama` installed for the colored logs.
- `python-dotenv` will be installed should you want to use the `--env-file` option.
- `PyYAML` will be installed to allow you to provide a `.yaml` file to `--log-config`, if desired.

Create an application, in `example.py`:

```python
Expand Down
Loading