Explorar el Código

Don't delay test pages' JS file

Alexandre Dieulot hace 6 años
padre
commit
3a39adeed1
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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}`
     }