teamhide / fastapi-boilerplate

FastAPI boilerplate for real world production
1.07k stars 170 forks source link

Can't open files in static folder #25

Closed r0otx closed 8 months ago

r0otx commented 1 year ago

I'm was mount static folder and can't get images in browser. I'm was see error Unicodedecodeerror: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte How fix it? I comment block code elif message.get("type") == "http.response.body": if body := message.get("body"): response_info.body += body.decode("utf8")

in response_log and it work for me.

teamhide commented 8 months ago

The code that logs the response was missing exception handling for the file. I will add it soon.