Skip to content

Commit

Permalink
fix(lint): use const instead of let
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcath committed Jul 23, 2024
1 parent 5b8b759 commit ff0699d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 4 additions & 4 deletions app/lib/utils/ensure-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ const headerNames = Object.freeze([
] as const)

export function getClientIPAddress(request: Request): string {
let headers = request.headers
const headers = request.headers

let ipAddress = headerNames
const ipAddress = headerNames
.flatMap(headerName => {
let value = headers.get(headerName)
const value = headers.get(headerName)
if (headerName === 'Forwarded') {
return parseForwardedHeader(value)
}
Expand All @@ -100,7 +100,7 @@ export function getClientIPAddress(request: Request): string {

function parseForwardedHeader(value: string | null): string | null {
if (!value) return null
for (let part of value.split(';')) {
for (const part of value.split(';')) {
if (part.startsWith('for=')) return part.slice(4)
}
return null
Expand Down
7 changes: 0 additions & 7 deletions tests/unit/sessions.spec.ts

This file was deleted.

0 comments on commit ff0699d

Please sign in to comment.