Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Binary file modified docs/en/docs/img/sponsors/coderabbit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions docs/en/docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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).
Expand Down Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion fastapi/__init__.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions fastapi/security/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
30 changes: 18 additions & 12 deletions tests/test_modules_same_name_body/test_main.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
import pytest
from fastapi.testclient import TestClient

from .app.main import app

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


Expand Down
2 changes: 1 addition & 1 deletion tests/test_security_http_digest_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Loading