Update index.js
Browse files
index.js
CHANGED
@@ -89,8 +89,10 @@ app.get('/*', async (req, res) => {
|
|
89 |
// 提取以 <script type="importmap" nonce=""> 开始,以 </script> 结尾的字符串
|
90 |
const importmapContent = result.htmlContent.match(/<script type="importmap" nonce="">.*?<\/script>/s);
|
91 |
if (importmapContent) {
|
|
|
|
|
92 |
res.set('Content-Type', 'text/plain');
|
93 |
-
res.send(
|
94 |
} else {
|
95 |
res.set('Content-Type', 'text/plain');
|
96 |
res.send('没有找到map匹配的字符串');
|
|
|
89 |
// 提取以 <script type="importmap" nonce=""> 开始,以 </script> 结尾的字符串
|
90 |
const importmapContent = result.htmlContent.match(/<script type="importmap" nonce="">.*?<\/script>/s);
|
91 |
if (importmapContent) {
|
92 |
+
let pextractedString = importmapContent[0];
|
93 |
+
pextractedString = pextractedString.replace('<script type="importmap" nonce="">', '{').replace('<\/script>', '}');
|
94 |
res.set('Content-Type', 'text/plain');
|
95 |
+
res.send(pextractedString); // 发送提取后的字符串
|
96 |
} else {
|
97 |
res.set('Content-Type', 'text/plain');
|
98 |
res.send('没有找到map匹配的字符串');
|