NCATSTranslator / Relay

Autonomous relay system for NCATS Biomedical Data Translator
MIT License
5 stars 24 forks source link

Messages Endpoint Encoding Issue #682

Closed MarkDWilliams closed 2 weeks ago

MarkDWilliams commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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

MarkDWilliams commented 2 weeks ago

@ShervinAbd92 you resolved this one already, right?