1
1
mirror of https://github.com/primer/css.git synced 2024-12-02 16:13:02 +03:00

chore: lint

This commit is contained in:
Shawn Allen 2019-02-19 11:39:42 -08:00
parent 5bed0029d5
commit ed34ad1d3f

View File

@ -30,7 +30,10 @@ export default function redirect(uri, status = 303) {
} }
export function redirectTrailingSlash(context, status = 301) { export function redirectTrailingSlash(context, status = 301) {
const {req: {url}, res} = context const {
req: {url},
res
} = context
if (url.endsWith('/')) { if (url.endsWith('/')) {
const withoutSlash = url.substr(0, url.length - 1) const withoutSlash = url.substr(0, url.length - 1)
res.writeHead(status, {Location: withoutSlash}) res.writeHead(status, {Location: withoutSlash})