lix02 commited on
Commit
a5e4f97
·
verified ·
1 Parent(s): 82d05b1

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +3 -1
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(importmapContent[0]); // 发送提取后的字符串
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匹配的字符串');