Skip to content

Commit

Permalink
fix: hash
Browse files Browse the repository at this point in the history
修复hash未能传递给静态资源的问题
  • Loading branch information
HalcyonAlcedo authored Jul 21, 2024
1 parent dcf7392 commit 7f536e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/puppeteer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ export default class Puppeteer {
/** 创建页面 */
const page = await this.browser.newPage()

/** 设置全局的HTTP头部 用于ws渲染识别 */
if (data.hash) await page.setExtraHTTPHeaders({ 'x-renderer-id': data.hash })

/** 加载页面 */
await page.goto(data.file, data.pageGotoParams)

Expand Down Expand Up @@ -198,9 +201,6 @@ export default class Puppeteer {
}
}

/** 设置全局的HTTP头部 用于ws渲染识别 */
if (data.hash) await page.setExtraHTTPHeaders({ 'x-renderer-id': data.hash })

const options = {
path: data.path,
type: data.type || 'jpeg',
Expand Down

0 comments on commit 7f536e3

Please sign in to comment.