e6519a7dd1
* add country code to meta tag * use blocked paths header * proper types * add test * Update functions/components/metaTagInjector.ts Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> * Update functions/components/metaTagInjector.ts Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> * Update src/pages/App.tsx Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> * pr suggestions * skip failing e2e * revert test change * take file from main --------- Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
19 lines
558 B
TypeScript
19 lines
558 B
TypeScript
/* eslint-disable import/no-unused-modules */
|
|
import { getMetadataRequest } from '../utils/getRequest'
|
|
import getToken from '../utils/getToken'
|
|
|
|
export const onRequest: PagesFunction = async ({ params, request, next }) => {
|
|
const res = next()
|
|
try {
|
|
const { index } = params
|
|
const networkName = index[0]?.toString()
|
|
const tokenAddress = index[1]?.toString()
|
|
if (!tokenAddress) {
|
|
return res
|
|
}
|
|
return getMetadataRequest(res, request, () => getToken(networkName, tokenAddress, request.url))
|
|
} catch (e) {
|
|
return res
|
|
}
|
|
}
|