Skip to content

Commit 32b23a1

Browse files
committed
refactor: simplify with at
1 parent ed23e04 commit 32b23a1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/node-static.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class Server extends events.EventEmitter {
136136
req.url ?? '',
137137
'http://localhost'
138138
).pathname);
139-
if (originalPathname.length && originalPathname.charAt(originalPathname.length - 1) !== '/') {
139+
if (originalPathname.length && originalPathname.at(-1) !== '/') {
140140
return finish(301, { Location: originalPathname + '/' });
141141
} else {
142142
this.respond(null, status, headers, [htmlIndex], stat, req, res, finish);

0 commit comments

Comments
 (0)