sanic-org / sanic

Accelerate your web app development | Build fast. Run fast.

Home Page:https://sanic.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSONResponse defaults to None content-type

ahopkins opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

@app.get("/")
async def handler(request: Request):
    return JSONResponse({"message": "Hello World!"})
╰─▶ curl localhost:9999   
HTTP/1.1 200 OK
content-length: 26
connection: keep-alive
alt-svc: 
content-type: None

{"message":"Hello World!"}

Code snippet

No response

Expected Behavior

content-type: application/json

How do you run Sanic?

Sanic CLI

Operating System

all

Sanic Version

LTS+

Additional context

No response