In node express with socket.io, why does my Content-Type header not include a charset value when loading the socket.io.js file? #4589
-
(Also posted here for internet points) Hello socket.io gurus, I have a node express server setup with socket.io. I had a question come up about why charset wasn't being set to UTF-8 in my response header when loading socket.io.js from my client-side html page. If I were to load it in the socket.io demo page, I see the expected charset:
In my app however, I see:
(note: I need to do a hard refresh to see these headers show up in dev tools otherwise I just get a 304 no change) Everything else in the app returns the charset header of UTF-8, so this leaves me scratching my head. Here's the minimal version of the app that can reproduce the issue: help.ts
hi.html
Getting it started:
Since this is a module-provided file, I cannot seem to override it with something like:
I'm stumped. Any idea of what I might be missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi! The charset isn't currently included when serving the client bundle: Lines 567 to 570 in 54d5ee0 I guess it's automatically in the chat demo (coming from https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js). |
Beta Was this translation helpful? Give feedback.
Hi! The charset isn't currently included when serving the client bundle:
socket.io/lib/index.ts
Lines 567 to 570 in 54d5ee0
I guess it's automatically in the chat demo (coming from https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js).