Skip to content

Commit 5f04ab4

Browse files
committed
Ignore html extension
1 parent 900ad7a commit 5f04ab4

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

library/sources/http-server/shouldDiscoverRoute.test.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,23 +105,15 @@ t.test("it allows html files", async () => {
105105
route: "/index.html",
106106
method: "GET",
107107
}),
108-
true
109-
);
110-
t.same(
111-
shouldDiscoverRoute({
112-
statusCode: 200,
113-
route: "/about.html",
114-
method: "GET",
115-
}),
116-
true
108+
false
117109
);
118110
t.same(
119111
shouldDiscoverRoute({
120112
statusCode: 200,
121113
route: "/contact.html",
122114
method: "GET",
123115
}),
124-
true
116+
false
125117
);
126118
});
127119

library/sources/http-server/shouldDiscoverRoute.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ export function shouldDiscoverRoute({
2929
// Remove the dot from the extension
3030
extension = extension.slice(1);
3131

32-
if (
33-
extension !== "html" &&
34-
extension.length >= 2 &&
35-
extension.length <= 4
36-
) {
32+
if (extension.length >= 2 && extension.length <= 4) {
3733
return false;
3834
}
3935
}

0 commit comments

Comments
 (0)