Skip to content

Commit a4dffc6

Browse files
committedJul 3, 2021
fix: remove x-sourcemap header
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
1 parent 7c44893 commit a4dffc6

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed
 

‎lib/index.ts

-3
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,6 @@ export class Server<
515515
);
516516
res.setHeader("ETag", expectedEtag);
517517

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

‎test/socket.io.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe("socket.io", () => {
5959
if (err) return done(err);
6060
expect(res.headers["content-type"]).to.be("application/javascript");
6161
expect(res.headers.etag).to.be('"' + clientVersion + '"');
62-
expect(res.headers["x-sourcemap"]).to.be(filename + ".map");
62+
expect(res.headers["x-sourcemap"]).to.be(undefined);
6363
expect(res.text).to.match(/engine\.io/);
6464
expect(res.status).to.be(200);
6565
done();

0 commit comments

Comments
 (0)
Please sign in to comment.