mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-06-04 23:16:52 +00:00
feat: enhance deployment and media handling
- Updated deployment configurations to disable Incremental Static Regeneration (ISR) and cache on demand pages for better performance control. - Extended .gitignore to include deployment-specific directories, preventing unnecessary files from being tracked. - Improved video handling in content by adding support for additional video types and enhancing video element attributes for better playback control. - Refactored post retrieval logic to ensure channel information is correctly merged and SEO data is accurately assigned. - Enhanced static file handling to include error handling and domain whitelisting for security and reliability.
This commit is contained in:
@@ -8,11 +8,15 @@ const targetWhitelist = [
|
||||
|
||||
export const prerender = false
|
||||
|
||||
export async function GET(Astro) {
|
||||
const { request, params, url } = Astro
|
||||
const target = new URL(params.url + url.search)
|
||||
if (!targetWhitelist.some(host => target.host.endsWith(host))) {
|
||||
return Astro.redirect(target.toString(), 302)
|
||||
export async function GET({ request, params, url }) {
|
||||
try {
|
||||
const target = new URL(params.url + url.search)
|
||||
if (!targetWhitelist.some(domain => target.hostname.endsWith(domain))) {
|
||||
return Response.redirect(target.toString(), 302)
|
||||
}
|
||||
return fetch(target.toString(), request)
|
||||
}
|
||||
catch (error) {
|
||||
return new Response(error.message, { status: 500 })
|
||||
}
|
||||
return fetch(target.toString(), request)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user