Skip to content

Commit 23b7760

Browse files
committed
Merge branch 'refactor/user-ip' into development
2 parents 98703d4 + dfdd735 commit 23b7760

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

packages/velog-server/src/common/plugins/global/ipaddrPlugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ const ipaddrPlugin: FastifyPluginAsync = async (fastify) => {
44
fastify.decorateRequest('ipaddr', null)
55
fastify.addHook('preHandler', (request, reply, done) => {
66
const fromCdnIp = request.headers['gcdn-client-ip']
7+
const xForwardedIp = request.headers['X-Forwarded-For']
8+
79
const graphCdnAddress = Array.isArray(fromCdnIp) ? fromCdnIp[0] : fromCdnIp
8-
const ipaddr = graphCdnAddress || request.ips?.slice(-1)[0] || request.ip
10+
const xForwardedForAdress = Array.isArray(xForwardedIp) ? xForwardedIp[0] : xForwardedIp
11+
12+
const ipaddr = xForwardedForAdress ?? graphCdnAddress ?? request.ips?.slice(-1)[0] ?? request.ip
913
request.ipaddr = ipaddr
1014
done()
1115
})

packages/velog-web/src/features/home/components/HomeTab/HomeTab.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
background: var(--border1);
7676
bottom: -10px;
7777

78-
@media screen and (max-width: 425px) {
79-
width: 29%;
78+
@media screen and (max-width: 430px) {
79+
width: 34%;
8080
margin-left: 3px;
8181
}
8282
}

packages/velog-web/src/features/home/components/HomeTab/HomeTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function HomeTab({ isFloatingHeader = false }: Props) {
6060
<motion.div
6161
initial={false}
6262
animate={{
63-
left: isFeed ? '71.33%' : isRecent ? '37.33%' : '1%',
63+
left: isFeed ? '68.33%' : isRecent ? '38.33%' : '2%',
6464
}}
6565
className={cx('indicator')}
6666
/>

0 commit comments

Comments
 (0)