mirror of
https://github.com/primer/css.git
synced 2024-11-27 17:52:45 +03:00
chore: lint
This commit is contained in:
parent
3da7c50383
commit
0988e6ecdf
@ -31,11 +31,11 @@ export default function redirect(uri, status = 303) {
|
||||
}
|
||||
|
||||
export function redirectTrailingSlash(context, status = 301) {
|
||||
const {req, res, err} = context
|
||||
const {req, res} = context
|
||||
if (req.url.endsWith('/')) {
|
||||
const {url} = req
|
||||
const withoutSlash = url.substr(0, url.length - 1)
|
||||
res.writeHead(301, {Location: withoutSlash})
|
||||
res.writeHead(status, {Location: withoutSlash})
|
||||
res.end()
|
||||
return true
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user