Skip to content

Commit

Permalink
fix: remove x-sourcemap header
Browse files Browse the repository at this point in the history
This header is useless, as the client bundle already contains a
sourceMappingURL field.

Besides, Firefox prints the following warning:

> <url> is being assigned a //# sourceMappingURL, but already has one

Related: #3958
  • Loading branch information
darrachequesne committed Jul 3, 2021
1 parent 7c44893 commit a4dffc6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,6 @@ export class Server<
);
res.setHeader("ETag", expectedEtag);

if (!isMap) {
res.setHeader("X-SourceMap", filename.substring(1) + ".map");
}
Server.sendFile(filename, req, res);
}

Expand Down
2 changes: 1 addition & 1 deletion test/socket.io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("socket.io", () => {
if (err) return done(err);
expect(res.headers["content-type"]).to.be("application/javascript");
expect(res.headers.etag).to.be('"' + clientVersion + '"');
expect(res.headers["x-sourcemap"]).to.be(filename + ".map");
expect(res.headers["x-sourcemap"]).to.be(undefined);
expect(res.text).to.match(/engine\.io/);
expect(res.status).to.be(200);
done();
Expand Down

0 comments on commit a4dffc6

Please sign in to comment.