Skip to content

Commit 572d9a6

Browse files
committed
Merge branch 'main' into feat/mpsc0x/added-aptos
2 parents 578f0a6 + ba0d1fa commit 572d9a6

12 files changed

Lines changed: 28984 additions & 14 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
"jest-environment-jsdom": "^29.7.0",
139139
"lint-staged": "^13.0.3",
140140
"prettier": "^2.8.1",
141+
"svgo": "^4.0.0",
141142
"typescript": "^5.0.4"
142143
},
143144
"contributors": [
@@ -163,4 +164,4 @@
163164
"budgetPercentIncreaseRed": 20,
164165
"showDetails": true
165166
}
166-
}
167+
}

pages/api/rpc-proxy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
116116
// Expected body: { chainId, method: 'GET' | 'POST', path: string, body?: object }
117117
const { method, path, body } = req.body;
118118

119-
if (!path) {
120-
return res.status(400).json({ error: 'Missing "path" for Aptos request' });
119+
if (!path || !path.startsWith('/') || path.includes('..')) {
120+
return res.status(400).json({ error: 'Invalid path for Aptos request' });
121121
}
122122

123123
const aptosUrl = `${rpcUrl}/v1${path}`;

0 commit comments

Comments
 (0)