bug fix
Browse files- src/routes/metaWeb.ts +2 -2
src/routes/metaWeb.ts
CHANGED
|
@@ -12,7 +12,7 @@ const app = new Hono();
|
|
| 12 |
app.get('/sticker/:productId', async (c) => {
|
| 13 |
const productId: number = parseInt(c.req.param('productId') || '-1');
|
| 14 |
if (productId === -1) return c.text('Invalid productId', 400);
|
| 15 |
-
const preferredLanguage = c.req.header('Accept-Language') || 'ja';
|
| 16 |
|
| 17 |
try {
|
| 18 |
const response = await ky(`https://store.line.me/stickershop/product/${productId}/${preferredLanguage}`, {
|
|
@@ -46,7 +46,7 @@ app.get('/sticker/:productId', async (c) => {
|
|
| 46 |
app.get('/emoji/:productId', async (c) => {
|
| 47 |
const productId: string = c.req.param('productId') || 'null';
|
| 48 |
if (!/^[0-9a-f]+$/.test(productId)) return c.text('Invalid productId', 400);
|
| 49 |
-
const preferredLanguage = c.req.header('Accept-Language') || 'ja';
|
| 50 |
|
| 51 |
try {
|
| 52 |
const response = await ky(`https://store.line.me/emojishop/product/${productId}/${preferredLanguage}`, {
|
|
|
|
| 12 |
app.get('/sticker/:productId', async (c) => {
|
| 13 |
const productId: number = parseInt(c.req.param('productId') || '-1');
|
| 14 |
if (productId === -1) return c.text('Invalid productId', 400);
|
| 15 |
+
const preferredLanguage = c.req.query('lang') ?? (c.req.header('Accept-Language') || 'ja');
|
| 16 |
|
| 17 |
try {
|
| 18 |
const response = await ky(`https://store.line.me/stickershop/product/${productId}/${preferredLanguage}`, {
|
|
|
|
| 46 |
app.get('/emoji/:productId', async (c) => {
|
| 47 |
const productId: string = c.req.param('productId') || 'null';
|
| 48 |
if (!/^[0-9a-f]+$/.test(productId)) return c.text('Invalid productId', 400);
|
| 49 |
+
const preferredLanguage = c.req.query('lang') ?? (c.req.header('Accept-Language') || 'ja');
|
| 50 |
|
| 51 |
try {
|
| 52 |
const response = await ky(`https://store.line.me/emojishop/product/${productId}/${preferredLanguage}`, {
|