@@ -21,7 +21,7 @@ const extractCss = async url => {
21
21
// Start CSS coverage. This is the meat and bones of this module
22
22
await page . coverage . startCSSCoverage ( )
23
23
24
- const response = await page . goto ( url , { waitUntil : 'networkidle2' } )
24
+ const response = await page . goto ( url , { waitUntil : 'networkidle2' } )
25
25
26
26
// Make sure that we only try to extract CSS from valid pages.
27
27
// Bail out if the response is an invalid request (400, 500)
@@ -63,14 +63,14 @@ const extractCss = async url => {
63
63
// we requested is an indication that this was a <style> tag
64
64
. filter ( styles => styles . url !== url )
65
65
// The `text` property contains the actual CSS
66
- . map ( ( { text } ) => text )
66
+ . map ( ( { text} ) => text )
67
67
. join ( '' )
68
68
69
69
return Promise . resolve ( styleSheetsApiCss + coverageCss )
70
70
}
71
71
72
72
module . exports = async ( req , res ) => {
73
- const url = normalizeUrl ( req . url . slice ( 1 ) , { stripWWW : false } )
73
+ const url = normalizeUrl ( req . url . slice ( 1 ) , { stripWWW : false } )
74
74
75
75
if ( ! isUrl ( url ) ) {
76
76
res . statusCode = 406
@@ -89,9 +89,9 @@ module.exports = async (req, res) => {
89
89
}
90
90
91
91
try {
92
- const css = url . endsWith ( '.css' )
93
- ? ( await got ( url ) ) . body
94
- : await extractCss ( url )
92
+ const css = url . endsWith ( '.css' ) ?
93
+ ( await got ( url ) ) . body :
94
+ await extractCss ( url )
95
95
96
96
res . setHeader ( 'Content-Type' , 'text/css' )
97
97
res . statusCode = 200
0 commit comments