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

Messages Endpoint Encoding Issue #682

Open
MarkDWilliams opened this issue Sep 9, 2024 · 3 comments
Open

Messages Endpoint Encoding Issue #682

MarkDWilliams opened this issue Sep 9, 2024 · 3 comments
Assignees

Comments

@MarkDWilliams
Copy link
Collaborator

The encoding on the ?trace=y message endpoints appear to be correctly encoded as JSON, but the non-trace endpoint is serving as html/text. Minor issue, but worth fixing.

@MarkDWilliams MarkDWilliams self-assigned this Sep 9, 2024
@MarkDWilliams
Copy link
Collaborator Author

Seems to be true of the latest PKs endpoint as well. We may want to just set the default encoding to JSON and specify the few places where what we're serving is not JSON (I can't think of any off the top of my head)

@ShervinAbd92
Copy link
Collaborator

maybe we should return JsonResponse(data) instead of HttpResponse(json.dumps(response) cause HttpResponse default to text/html content-type but the JsonResponse automatically serializes the dict to JSON string and changes the content-type to applicatin/json

@MarkDWilliams
Copy link
Collaborator Author

Yeah, I haven't had a chance to look at how we're doing the encoding. Andrew Su just pointed out that the messages had the wrong encoding header and I figured I'd make a ticket for it before I forgot. I don't think it's an issue that needs to be resolved ASAP, but one we should look into if/when we have some time

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

No branches or pull requests

2 participants