-
First check
DescriptionHello! I have noticed that fastAPI's HTTP 204's It appears that fastapi is attempting to serialize as a JSON, and thus adding data to the message body. Here is an example that you can use to reproduce: from fastapi import FastAPI, HTTPException
app = FastAPI()
@app.get("/")
def read_root():
raise HTTPException(status_code=204)Curling this will result in: This line indicates the issue: It looks as though it's adding the following to the body: Expected BehaviorThe expected behavior is to not return anything in the body. This behavior should be the default when handling The current behavior can cause issues if you have your service being fronted with a proxy that strongly enforces the HTTP spec. I don't have time today to attempt to fix, but would be happy to. Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Duplicated #2832 |
Beta Was this translation helpful? Give feedback.
-
|
Doh! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the help here @Kludex ! 👏 🙇 Thanks for reporting back and closing the issue @mikegrima 👍
|
Beta Was this translation helpful? Give feedback.
Duplicated #2832