浏览代码

Don't delay test pages' JS file

Alexandre Dieulot 6 年之前
父节点
当前提交
3a39adeed1
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      test/app.js

+ 2 - 2
test/app.js

@@ -26,8 +26,6 @@ function sha384(data) {
 }
 
 async function requestListener(req, res) {
-  await sleep(SLEEP_TIME)
-
   let headers = {
     'Content-Type': 'text/html',
   }
@@ -48,6 +46,8 @@ async function requestListener(req, res) {
     content += jsContent
   }
   else if (!isNaN(page)) {
+    await sleep(SLEEP_TIME)
+
     if (CACHE_MAX_AGE) {
       headers['Cache-Control'] = `max-age=${CACHE_MAX_AGE}`
     }