Skip to content

Commit

Permalink
Merge branch 'main' of github.com:sanic-org/sanic
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Dec 16, 2024
2 parents b7ca9f3 + cce077c commit 0cc7076
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sanic/mixins/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async def _static_request_handler(
self,
request: Request,
*,
file_or_directory: PathLike,
file_or_directory: str,
use_modified_since: bool,
use_content_range: bool,
stream_large_files: Union[bool, int],
Expand All @@ -259,7 +259,7 @@ async def _static_request_handler(
):
not_found = FileNotFound(
"File not found",
path=file_or_directory,
path=Path(file_or_directory),
relative_url=__file_uri__,
)

Expand Down
5 changes: 3 additions & 2 deletions tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from sanic.constants import DEFAULT_HTTP_CONTENT_TYPE
from sanic.exceptions import ServerError
from sanic.request import RequestParameters
from sanic.response import html, json, text
from sanic.response import BaseHTTPResponse, html, json, text


def encode_basic_auth_credentials(username, password):
Expand Down Expand Up @@ -2253,8 +2253,9 @@ async def delete(request, foo):
{"name": request.route.name, "body": str(request.body), "foo": foo}
)

dumps = BaseHTTPResponse._dumps
payload = {"test": "OK"}
data = str(json_dumps(payload).encode())
data = str(dumps(payload).encode())

_, response = app.test_client.put("/", json=payload)
assert response.status == 200
Expand Down

0 comments on commit 0cc7076

Please sign in to comment.