Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONResponse defaults to None content-type #2736

Closed
1 task done
ahopkins opened this issue Apr 9, 2023 · 0 comments · Fixed by #2737
Closed
1 task done

JSONResponse defaults to None content-type #2736

ahopkins opened this issue Apr 9, 2023 · 0 comments · Fixed by #2737
Assignees

Comments

@ahopkins
Copy link
Member

ahopkins commented Apr 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants