UC Enjoyer
UC Enjoyer3mo ago

Issue with Deno (Oak?)

<deleted context>
[uncaught application error]: Http - error writing a body to connection: received corrupt message of type InvalidContentType: received corrupt message of type InvalidContentType

at async HttpConn.nextRequest (ext:deno_http/01_http.js:114:21)
at async serve (https://deno.land/x/oak@v12.6.1/http_server_native.ts:112:34)
[uncaught application error]: Http - error writing a body to connection: received corrupt message of type InvalidContentType: received corrupt message of type InvalidContentType

at async HttpConn.nextRequest (ext:deno_http/01_http.js:114:21)
at async serve (https://deno.land/x/oak@v12.6.1/http_server_native.ts:112:34)
2 Replies
UC Enjoyer
UC Enjoyer3mo ago
nvm just some stupid cert error :deno_thumbs_up:
Deno AI Helper
Deno AI Helper3mo ago
I apologize, but I wasn't able to find the answer to your question in the official Deno documentation. However, based on the error message you've provided, it seems like there might be an issue with the content type being set or interpreted incorrectly when your Oak application is trying to write a response body to the connection. The error InvalidContentType suggests that there might be a mismatch or a formatting issue with the Content-Type header in the HTTP response. Make sure that the content type you are setting in your response headers matches the actual content you are sending. For example, if you are sending JSON, the content type should be application/json. Please note that this advice is not based on the Deno documentation, and I would recommend double-checking the accuracy of this advice. If the issue persists, you might want to look into the Oak middleware or route handler that is responsible for generating the response to ensure that the content type is being set correctly.