Skip to content

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

Answered by darrachequesne
owntheweb asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! The charset isn't currently included when serving the client bundle:

socket.io/lib/index.ts

Lines 567 to 570 in 54d5ee0

res.setHeader(
"Content-Type",
"application/" + (isMap ? "json" : "javascript")
);

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).

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@owntheweb
Comment options

@darrachequesne
Comment options

@qiulang
Comment options

@darrachequesne
Comment options

Answer selected by owntheweb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants