Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/hap-server/src/preview/create-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ const { PACKAGER_BUILD_DONE, PACKAGER_WATCH_START, PACKAGER_BUILD_PROGRESS } = e
const allowFiles = ['sitemap.json', 'app-chunks.json', 'page-chunks.json']

function genWebJsUrl(version) {
version = version ? '-' + version : ''
return `https://statres.quickapp.cn/quickapp/ide/web${version}.js`
// web.js后面加一个时间戳,防止更新后disk缓存一直是之前的
const jsFile = version ? `web-${version}.js` : `web.js?t=${Date.now()}`
return `https://statres.quickapp.cn/quickapp/ide/${jsFile}`
}

function jsonParse(data) {
Expand Down
5 changes: 0 additions & 5 deletions packages/hap-server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export async function launch(conf) {
const chunks = []
ctx.req.on('data', (chunk) => chunks.push(chunk))
ctx.req.on('end', () => resolve(Buffer.concat(chunks)))
ctx.req.on('error', reject)
})
const requestHeaders = { ...ctx.headers }
delete requestHeaders.host
Expand All @@ -73,10 +72,6 @@ export async function launch(conf) {
})
})
})
req.on('error', reject)
req.setTimeout(30000, () => {
req.destroy(new Error('proxy request timeout'))
})
if (requestBody.length > 0) {
req.write(requestBody)
}
Expand Down
Loading