@lark-apaas/fullstack-rspack-preset 1.0.13-alpha.proxy.7 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,20 +18,13 @@ function registerSnapDomProxyMiddleware(serverApp, options = {}) {
18
18
  if (!targetUrl) {
19
19
  return res.status(400).json({ error: 'Missing url parameter' });
20
20
  }
21
- // 解码 URL
22
- try {
23
- const decoded = Buffer.from(targetUrl, 'base64').toString('utf-8');
24
- if (decoded.startsWith('http')) {
25
- targetUrl = decoded;
26
- }
27
- else {
28
- targetUrl = decodeURIComponent(targetUrl);
29
- }
30
- }
31
- catch {
32
- targetUrl = decodeURIComponent(targetUrl);
33
- }
34
- const response = await fetch(targetUrl);
21
+ targetUrl = decodeURIComponent(targetUrl);
22
+ const fetchOption = {
23
+ headers: {
24
+ cookie: req.headers.cookie || '',
25
+ },
26
+ };
27
+ const response = await fetch(targetUrl, fetchOption);
35
28
  const contentType = response.headers.get('content-type');
36
29
  if (contentType) {
37
30
  res.setHeader('Content-Type', contentType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-rspack-preset",
3
- "version": "1.0.13-alpha.proxy.7",
3
+ "version": "1.0.13",
4
4
  "files": [
5
5
  "lib",
6
6
  "patches",