diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index aec327f48cf46..0b3096143e4d2 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -62,7 +62,10 @@ jobs: env: PROJECT_NAME: fastapitiangolo BRANCH: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' && 'main' ) || ( github.event.workflow_run.head_sha ) }} - uses: cloudflare/wrangler-action@v3 + # TODO: Use v3 when it's fixed, probably in v3.11 + # https://github.com/cloudflare/wrangler-action/issues/307 + uses: cloudflare/wrangler-action@v3.14 + # uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} diff --git a/docs/en/docs/img/sponsors/coderabbit.png b/docs/en/docs/img/sponsors/coderabbit.png index 1fb74569be3ef..74c25e88466fa 100644 Binary files a/docs/en/docs/img/sponsors/coderabbit.png and b/docs/en/docs/img/sponsors/coderabbit.png differ diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 833d52bda4a27..84d680d91c065 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -7,12 +7,6 @@ hide: ## Latest Changes -## 0.115.9 - -### Fixes - -* 🐛 Ensure that `HTTPDigest` only raises an exception when `auto_error is True`. PR [#2939](https://github.com/fastapi/fastapi/pull/2939) by [@arthurio](https://github.com/arthurio). - ### Refactors * ✅ Simplify tests for `query_params_str_validations`. PR [#13218](https://github.com/fastapi/fastapi/pull/13218) by [@alv2017](https://github.com/alv2017). @@ -21,7 +15,6 @@ hide: ### Docs -* 🍱 Update sponsors: CodeRabbit logo. PR [#13424](https://github.com/fastapi/fastapi/pull/13424) by [@tiangolo](https://github.com/tiangolo). * 🩺 Unify the badges across all tutorial translations. PR [#13329](https://github.com/fastapi/fastapi/pull/13329) by [@svlandeg](https://github.com/svlandeg). * 📝 Fix typos in virtual environments documentation. PR [#13396](https://github.com/fastapi/fastapi/pull/13396) by [@bullet-ant](https://github.com/bullet-ant). * 🐛 Fix issue with Swagger theme change example in the official tutorial. PR [#13289](https://github.com/fastapi/fastapi/pull/13289) by [@Zerohertz](https://github.com/Zerohertz). @@ -55,8 +48,6 @@ hide: ### Internal -* ✅ Fix a minor bug in the test `tests/test_modules_same_name_body/test_main.py`. PR [#13411](https://github.com/fastapi/fastapi/pull/13411) by [@alv2017](https://github.com/alv2017). -* 👷 Use `wrangler-action` v3. PR [#13415](https://github.com/fastapi/fastapi/pull/13415) by [@joakimnordling](https://github.com/joakimnordling). * 🔧 Update sponsors: add CodeRabbit. PR [#13402](https://github.com/fastapi/fastapi/pull/13402) by [@tiangolo](https://github.com/tiangolo). * 🔧 Update team: Add Ludovico. PR [#13390](https://github.com/fastapi/fastapi/pull/13390) by [@tiangolo](https://github.com/tiangolo). * 🔧 Update sponsors: Add LambdaTest. PR [#13389](https://github.com/fastapi/fastapi/pull/13389) by [@tiangolo](https://github.com/tiangolo). diff --git a/fastapi/__init__.py b/fastapi/__init__.py index c0b4cb989a7c0..e3e0200aed181 100644 --- a/fastapi/__init__.py +++ b/fastapi/__init__.py @@ -1,6 +1,6 @@ """FastAPI framework, high performance, easy to learn, fast to code, ready for production""" -__version__ = "0.115.9" +__version__ = "0.115.8" from starlette import status as status diff --git a/fastapi/security/http.py b/fastapi/security/http.py index 9ab2df3c98e1e..f4d285f2617c1 100644 --- a/fastapi/security/http.py +++ b/fastapi/security/http.py @@ -408,11 +408,11 @@ async def __call__( if not (authorization and scheme and credentials): if self.auto_error: raise HTTPException( - status_code=HTTP_403_FORBIDDEN, detail="Not authenticated" + status_code=HTTP_403_FORBIDDEN detail="Not authenticated" ) else: return None - if scheme.lower() != "digest": + if scheme.lower() != "digest" if self.auto_error: raise HTTPException( status_code=HTTP_403_FORBIDDEN, diff --git a/tests/test_modules_same_name_body/test_main.py b/tests/test_modules_same_name_body/test_main.py index 263d87df26322..cc165bdcaa258 100644 --- a/tests/test_modules_same_name_body/test_main.py +++ b/tests/test_modules_same_name_body/test_main.py @@ -1,4 +1,3 @@ -import pytest from fastapi.testclient import TestClient from .app.main import app @@ -6,22 +5,29 @@ client = TestClient(app) -@pytest.mark.parametrize( - "path", ["/a/compute", "/a/compute/", "/b/compute", "/b/compute/"] -) -def test_post(path): +def test_post_a(): data = {"a": 2, "b": "foo"} - response = client.post(path, json=data) + response = client.post("/a/compute", json=data) assert response.status_code == 200, response.text - assert data == response.json() + data = response.json() -@pytest.mark.parametrize( - "path", ["/a/compute", "/a/compute/", "/b/compute", "/b/compute/"] -) -def test_post_invalid(path): +def test_post_a_invalid(): data = {"a": "bar", "b": "foo"} - response = client.post(path, json=data) + response = client.post("/a/compute", json=data) + assert response.status_code == 422, response.text + + +def test_post_b(): + data = {"a": 2, "b": "foo"} + response = client.post("/b/compute/", json=data) + assert response.status_code == 200, response.text + data = response.json() + + +def test_post_b_invalid(): + data = {"a": "bar", "b": "foo"} + response = client.post("/b/compute/", json=data) assert response.status_code == 422, response.text diff --git a/tests/test_security_http_digest_optional.py b/tests/test_security_http_digest_optional.py index 0d66f9c72e565..9bfad6101d58f 100644 --- a/tests/test_security_http_digest_optional.py +++ b/tests/test_security_http_digest_optional.py @@ -12,7 +12,7 @@ @app.get("/users/me") def read_current_user( credentials: Optional[HTTPAuthorizationCredentials] = Security(security), -): +) if credentials is None: return {"msg": "Create an account first"} return {"scheme": credentials.scheme, "credentials": credentials.credentials}