Skip to content

Fix server-side Douban proxy resolution and Top250 regex - #211

Draft
roc-ld wants to merge 2 commits into
MoonTechLab:mainfrom
roc-ld:fix/douban-server-proxy
Draft

roc-ld wants to merge 2 commits into
MoonTechLab:mainfrom
roc-ld:fix/douban-server-proxy

Conversation

@roc-ld

@roc-ld roc-ld commented Nov 2, 2026

Copy link
Copy Markdown

Summary

This PR fixes a bug where server-side Douban API requests ignored the configured proxy and directly accessed Douban source domains, causing requests to fail on servers that cannot reach Douban directly.

What changed

  • Added central proxy resolution in src/lib/douban.ts
  • Server-side routes now respect NEXT_PUBLIC_DOUBAN_PROXY_TYPE
  • Reused the same proxy behavior as the client-side Douban logic
  • Corrected the malformed Top250 HTML regex in src/app/api/douban/route.ts

Why

When NEXT_PUBLIC_DOUBAN_PROXY_TYPE was set (for example cmliussss-cdn-ali), the server still called direct Douban endpoints such as:

  • https://movie.douban.com/...
  • https://m.douban.com/...

This bypassed the configured CDN proxy and caused timeouts on deployments without direct access to Douban.

Result

Server-side requests now follow the configured proxy logic and match the client-side behavior.

@roc-ld
roc-ld marked this pull request as draft November 2, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant