Skip to content

Commit

Permalink
fix(app): encode filter url
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Jul 21, 2024
1 parent f8c1ee8 commit a8b0059
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/app/src/logic/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ export function generateFeed(...params: URLSearchParams[]) {
}
filters.push({ ...filter });
}
return JSON.stringify(filters);
return encodeURIComponent(JSON.stringify(filters));
}
2 changes: 1 addition & 1 deletion packages/app/src/pages/feed.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const DESCRIPTION = `Anime Garden 是動漫花園資源網的第三方镜像站,
export const GET: APIRoute = async (context) => {
try {
const getFilter = () => {
const filterString = context.url.searchParams.get('filter');
const filterString = decodeURIComponent(context.url.searchParams.get('filter'));
try {
const rawFilter = filterString ? JSON.parse(filterString) : { page: 1, pageSize: 1000 };
return { ok: true, filter: rawFilter } as const;
Expand Down

0 comments on commit a8b0059

Please sign in to comment.