fix(server): prettier saves the day as always (snark)
This commit is contained in:
@@ -171,16 +171,15 @@ export async function determineClientIpAddressMiddleware(
|
||||
) {
|
||||
const ip = getIpFromRequest(req)
|
||||
if (ip) {
|
||||
try{
|
||||
try {
|
||||
const isV6 = ip.includes(':')
|
||||
if(isV6) {
|
||||
if (isV6) {
|
||||
req.headers[X_SPECKLE_CLIENT_IP_HEADER] = ip
|
||||
} else {
|
||||
const mask = new Netmask(`${ip}/24`)
|
||||
req.headers[X_SPECKLE_CLIENT_IP_HEADER] = mask.broadcast
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
} catch (e) {
|
||||
req.headers[X_SPECKLE_CLIENT_IP_HEADER] = ip || 'ip-parse-error'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user