Skip to content

Commit

Permalink
Chore: pre-commit autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed May 17, 2024
1 parent 45938d6 commit 656e108
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,3 @@ test/.DS_Store

# Cython debug symbols
cython_debug/

13 changes: 8 additions & 5 deletions src/middleware.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import logging
from fastapi import Request, Response, Depends
import base64
import logging

from fastapi import Depends, Request, Response
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.responses import JSONResponse, StreamingResponse, PlainTextResponse
from starlette.responses import JSONResponse, PlainTextResponse, StreamingResponse

import state

Expand Down Expand Up @@ -66,9 +67,11 @@ async def dispatch(self, request: Request, call_next):

return response

from starlette.types import Send, Message
import asyncio

from starlette.types import Message, Send


class LoggingStreamingResponse(StreamingResponse):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand All @@ -91,4 +94,4 @@ async def stream_response(self, send: Send):

@property
def body(self):
return b"".join(self.body_chunks).decode("utf-8")
return b"".join(self.body_chunks).decode("utf-8")
2 changes: 0 additions & 2 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@

# Project imports
import utilities
import state
from middleware import LoggingMiddleware


# Set up logging
LOGGING_FORMAT = \
"%(asctime)s - %(module)s:%(funcName)s %(levelname)s - %(message)s"
Expand Down

0 comments on commit 656e108

Please sign in to comment.